- Posts: 110
- Thank you received: 4
Article Code Generator
13 years 11 months ago #70055
by mike
Article Code Generator was created by mike
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
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.
13 years 11 months ago #70117
by Xavier
Replied by Xavier on topic Re: Article Code Generator
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:
Like:
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:
Code:
elseif(empty($element->product_code)){
return false;
}
Code:
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.177 seconds