Article Code Generator

  • Posts: 108
  • Thank you received: 4
  • Hikashop Business
12 years 1 month ago #70055

Hello there

I would like to ask, if there is somehow a way to generate an article code like it's possible with the order number. There it is possible to specify the "Order number format" in the settings. This would be a super-nice feature for a possible next version if there is no way to specify the article format already.

Best regards
Mike

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

  • Posts: 13201
  • Thank you received: 2322
12 years 1 month ago #70117

Hi mike,

Yes actually it's not possible in HikaShop.
But I think that it can be added in the file "yourSite\administrator\components\com_hikashop\classes\product.php" in the function "save()".

Add a check after:

elseif(empty($element->product_code)){
	return false;
}
Like:
elseif(!empty($element->product_code) && preg_match("#^{#", "{my_code_format}")){
        //do a preg_replace to remove the "{" & "}" tags. 
        //select the max product id in the product table
        //format the new code
}

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

Time to create page: 0.068 seconds
Powered by Kunena Forum