Assign a category to a specifc vendor?

  • Posts: 303
  • Thank you received: 4
  • Hikaauction Standard
10 months 2 weeks ago #352039

Hi there,

I am using Calcbuilder on my site to generate a price for a list of items. This can be added to the Hikashop cart and paid for as a custom product.

The problem is, I have many different branches that are set up as vendors, and they have different bank accounts and payment processors, so I need to assign the custom product to a specific vendor, so that it will use their payment processor on checkout.

There is some custom code that does this:

$hk_quantity=1;
$hk_product_name='Black chain link fence, standard';
$hk_product_description='Based on the information provided, you will require these parts for your fence project. Note that this price does not include gates. Please add any gate units separately.';
$hk_product_description.='<br>'.$_layoutsolutionp;
$hk_product_code='COD';

$hk_pricehikaproduct=str_replace("$","",$myprice);
$hk_pricehikaproduct=str_replace(",","",$hk_pricehikaproduct);
//Attach new product to category 37 (custom products)

$hk_productfields=array();
$hk_productfields['id_category']=37;


I can designate the product to a specific category, but I need to be able to link that category to a specific vendor. How do I do this?

Thanks.

Last edit: 10 months 2 weeks ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 81478
  • Thank you received: 13062
  • MODERATOR
10 months 2 weeks ago #352046

Hi,

Supposing you're creating a real custom product, you must probably have a $product object you're saving with class.product as explained with the last code example here:
www.hikashop.com/support/documentation/6...umentation.html#code
so in that case, assigning a vendor to that new product can be done easily by adding such line of code:

$product->product_vendor_id = xxx;
where xxx is the id of the vendor.

Please Log in or Create an account to join the conversation.

Moderators: Obsidev
Time to create page: 0.040 seconds
Powered by Kunena Forum