Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
You are here: HomeForum
Welcome, Guest

search also for product_sku field
(1 viewing) (1) Guest
  • Page:
  • 1

TOPIC: search also for product_sku field

search also for product_sku field 7 years, 3 months ago #30026

Hello,
I would like to search the keyword also in product_sku, so I have modified the file "core/helper.php" from line 40 to line 45:
if($search_category_id != 0)
		{
			$query .= " LEFT JOIN `#__virtuemart_product_categories` pc ON (p.virtuemart_product_id = pc.virtuemart_product_id) WHERE pc.virtuemart_category_id = ".$search_category_id." AND (p.product_name LIKE '%".$search_name."%' OR [what prefix?].product_sku LIKE '%".$search_name."%' OR p.product_s_desc LIKE '%".$search_name."%' OR p.product_desc LIKE '%".$search_name."%')";
		}else{
			$query .= " LEFT JOIN `#__virtuemart_products` pd ON (p.virtuemart_product_id = pd.virtuemart_product_id) WHERE pd.published = 1 AND (p.product_name LIKE '%".$search_name."%' OR pd.product_sku LIKE '%".$search_name."%' OR p.product_s_desc LIKE '%".$search_name."%' OR p.product_desc LIKE '%".$search_name."%')";
		}

i added "OR pd.product_sku LIKE '%".$search_name."%'" in ELSE section and it works;
but in THEN section i don't know what is the prefix for "product_sku" field, and i wrote "OR [what prefix?].product_sku LIKE '%".$search_name."%' "

Anyone can help me?
thanks!
The following user(s) said Thank You: Gatto
  • Page:
  • 1
Time to create page: 0.28 seconds

Notification

Please find your issue via Suggested Posts before submitting your question. We have solved the most of issues and maybe your issue was solved before.

Latest My Topics

No posts to display.

Love all our templates?

Join our membership clubs starting at $49 only for access to all of our templates

Join Now
Home Pricing
Your Cart is currently empty!
Product update
Coupon
add
Coupon code invalid! Please re-enter!
AJAX loader
SearchSupport
Magento Themes Magento Extensions Free Magento Extensions Prestashop Themes Prestashop Modules Magento 2 Themes