- Posts: 640
- Thank you received: 16
Save Manufacturer as a text in custom field
- PeterChain
-
Topic Author
- Offline
Less
More
13 years 4 months ago - 13 years 4 months ago #102538
by PeterChain
Save Manufacturer as a text in custom field was created by PeterChain
Configuring a filter scheme I found this bad limitation:
In a text box I can enter text and assign several fields to be matched. This works fine.
But when I write the brand of a product it is not found because the product_manufacturer_id field is storing an id number and not the text name of the brand.
So I should create an extra field where the text of the category gets stored, but how?
I already have the code to show a manufacturer by its name in products listing, is something like this:
but how and where I should finish this code to make it save the $brandName in a cutom_brand_field each time a product gets Submited/saved?
please understand I am not a PHP coder so don't get any knowledge for granted, I really don't know where to start from, I need very precise indication.
Thanks!
In a text box I can enter text and assign several fields to be matched. This works fine.
But when I write the brand of a product it is not found because the product_manufacturer_id field is storing an id number and not the text name of the brand.
So I should create an extra field where the text of the category gets stored, but how?
I already have the code to show a manufacturer by its name in products listing, is something like this:
Code:
$db = JFactory::getDBO();
$db->setQuery('SELECT category_name FROM '.hikashop_table('category').' WHERE category_id='.(int)$this->row->product_manufacturer_id);
$brandName = $db->loadResult();
please understand I am not a PHP coder so don't get any knowledge for granted, I really don't know where to start from, I need very precise indication.
Thanks!
Last edit: 13 years 4 months ago by Jerome.
Please Log in or Create an account to join the conversation.
13 years 4 months ago #102557
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Save Manufacturer as a text in custom field
Hi,
You have the triggers in the Product API
www.hikashop.com/en/support/documentatio...ntation.html#product
Like : onAfterProductCreate and onAfterProductUpdate
You will have to create a little plugin in the hikashop category.
Regards,
You have the triggers in the Product API
www.hikashop.com/en/support/documentatio...ntation.html#product
Like : onAfterProductCreate and onAfterProductUpdate
You will have to create a little plugin in the hikashop category.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Please Log in or Create an account to join the conversation.
- PeterChain
-
Topic Author
- Offline
Less
More
- Posts: 640
- Thank you received: 16
13 years 4 months ago #102563
by PeterChain
Replied by PeterChain on topic Save Manufacturer as a text in custom field
I don't dare to send you a "Thank you" click until I try this, I never made a plugin but hope is as simple as it looks in the instructions... so we'll stay in contact for this.
thank you for the advice!
thank you for the advice!
Please Log in or Create an account to join the conversation.
13 years 4 months ago #102573
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
Replied by Jerome on topic Save Manufacturer as a text in custom field
Hi,
You can find some tutorial in the joomla website.
You can use a little plugin like "hikashop history". You will have the structure of the XML file and you can remove the no-useful function in the php file.
By renaming the files, changing the names in the XML and creating a zip (with the files), you will have a little plugin.
It is not really complicated but some development skills are required.
Regards,
You can find some tutorial in the joomla website.
You can use a little plugin like "hikashop history". You will have the structure of the XML file and you can remove the no-useful function in the php file.
By renaming the files, changing the names in the XML and creating a zip (with the files), you will have a little plugin.
It is not really complicated but some development skills are required.
Regards,
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: PeterChain
Please Log in or Create an account to join the conversation.
- PeterChain
-
Topic Author
- Offline
Less
More
- Posts: 640
- Thank you received: 16
13 years 4 months ago #102574
by PeterChain
Replied by PeterChain on topic Save Manufacturer as a text in custom field
Thanks for your support, I will try sometime during this week. knowing your support team is so close it makes me more dareful to try it!
Please Log in or Create an account to join the conversation.
Time to create page: 0.177 seconds