Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Product Data Retreive From Sku Rate Topic   - - - - -

 
  • MrCodexCY
  • Junior Member
  • Members
  • Join Date: 12-Jun 10
  • 29 posts

Posted 15 July 2017 - 12:29 PM #1

I am trying to develop a function to retrieve products with the same SKU code as the current product and list them in a table. I know I can use fn_get_product_data to get data by product ID but I don't seem to be able to find a way to get the same sku product's ids, so any suggestions or guidance would be highly appreciated.

 

Update:

Used db_get_field to execute a query for that.



 
  • eComLabs
  • CS-Cart Expert
  • Authorized Reseller
  • Join Date: 27-Jan 14
  • 14,992 posts

Posted 17 July 2017 - 05:40 AM #2

If I understand you correctly, you can use the following function to get all products by specific sku

$params = array(
    'extend' => array('description'),
    'pcode' => $product['product_code'],
    'exclude_pid' => $product['product_id'],
);
list($products, ) = fn_get_products($params);
fn_gather_additional_products_data($products, array(
      'get_icon' => true,
      'get_detailed' => true,
      'get_additional' => false,
      'get_options'=> true
));

(!) Not tested


GET A FREE QUOTE | CS-Cart Add-ons | CS-Cart Licenses | CS-Cart Development | CS-Cart Design | Server Configuration

Certified CS-Cart RU Developer | Сертифицированный разработчик на CS-Cart Русская Версия