- Posts: 10
- Thank you received: 0
Count Characters for Automatic Entry of Quantity
11 years 9 months ago #182444
by jbrandvik
Count Characters for Automatic Entry of Quantity was created by jbrandvik
-- url of the page with the problem -- :
horseshoeengraver.com/shop/product/8-custom-lettering
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 2.5.20
-- PHP version -- : 5.5.3
-- Browser(s) name and version -- : ANY
Hi, I am a silversmith (not a programmer) who sells custom engraving for some of my products. I charge a fee per each character that I hand-engrave. Is there a way I can have the customer type their desired inscription in a field and have HikaShop automatically count the number characters in the field in order to automatically enter the correct quantity. (Asking the customers to count the number of characters in their inscriptions never ends well.)
Thanks!
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 2.5.20
-- PHP version -- : 5.5.3
-- Browser(s) name and version -- : ANY
Hi, I am a silversmith (not a programmer) who sells custom engraving for some of my products. I charge a fee per each character that I hand-engrave. Is there a way I can have the customer type their desired inscription in a field and have HikaShop automatically count the number characters in the field in order to automatically enter the correct quantity. (Asking the customers to count the number of characters in their inscriptions never ends well.)
Thanks!
Please Log in or Create an account to join the conversation.
11 years 9 months ago #182604
by nicolas
Replied by nicolas on topic Count Characters for Automatic Entry of Quantity
Hi,
Here is a small plugin you can install on your website and then configure to set the quantity of the product in the cart to the number of letters of a custom item field that the customer can fill on the product page:
Here is a small plugin you can install on your website and then configure to set the quantity of the product in the cart to the number of letters of a custom item field that the customer can fill on the product page:
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
Please Log in or Create an account to join the conversation.
11 years 9 months ago - 11 years 9 months ago #182673
by jbrandvik
Replied by jbrandvik on topic Count Characters for Automatic Entry of Quantity
Thanks Nicolas,
I really appreciate you taking the time to create the plugin. This looks like the perfect fix for my problem. Unfortunately when I enable the plug in and put something into my cart, my website no longer displays in Safari. I have disabled all third party modules and plugins and the problem still exists.
Here was my workflow;
1 - Installed the plugin and enabled it changing the input field name "from_field" to "inscription2" and saved.
2 - Created a custom text field in the item table labeled "inscription2" and assigned it to the proper category
The custom text field is then available on the product pages but when I add anything to the cart, any page in the shop of my website fails to display.
Hopefully you will know what the problem is.
I really appreciate you taking the time to create the plugin. This looks like the perfect fix for my problem. Unfortunately when I enable the plug in and put something into my cart, my website no longer displays in Safari. I have disabled all third party modules and plugins and the problem still exists.
Here was my workflow;
1 - Installed the plugin and enabled it changing the input field name "from_field" to "inscription2" and saved.
2 - Created a custom text field in the item table labeled "inscription2" and assigned it to the proper category
The custom text field is then available on the product pages but when I add anything to the cart, any page in the shop of my website fails to display.
Hopefully you will know what the problem is.
Last edit: 11 years 9 months ago by jbrandvik.
Please Log in or Create an account to join the conversation.
11 years 9 months ago #182700
by nicolas
Replied by nicolas on topic Count Characters for Automatic Entry of Quantity
Hi,
Please turn on the debug mode and error reporting options of the Joomla configuration and try again. What error message do you get when it doesn't work ?
Knowing the error will help me tell you what to do.
Please turn on the debug mode and error reporting options of the Joomla configuration and try again. What error message do you get when it doesn't work ?
Knowing the error will help me tell you what to do.
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183025
by jbrandvik
Replied by jbrandvik on topic Count Characters for Automatic Entry of Quantity
When the plugin is enabled, this error is generated when going into the Hikashop category page. Strict Standards: Only variables should be assigned by reference in
\Websites\Skip\horseshoeengraver.com\www\plugins\system\rsseo\rsseo.php on line 373 Fatal error: Call to a member function get() on a non-object in
\Websites\Skip\horseshoeengraver.com\www\plugins\system\custom_price_letter_count\custom_price_letter_count.php on line 24
Then this error is generated when anything is added to the cart. Fatal error: Call to a member function get() on a non-object in
\Websites\Skip\horseshoeengraver.com\www\plugins\system\custom_price_letter_count\custom_price_letter_count.php on line 24
Thanks
\Websites\Skip\horseshoeengraver.com\www\plugins\system\rsseo\rsseo.php on line 373 Fatal error: Call to a member function get() on a non-object in
\Websites\Skip\horseshoeengraver.com\www\plugins\system\custom_price_letter_count\custom_price_letter_count.php on line 24Then this error is generated when anything is added to the cart. Fatal error: Call to a member function get() on a non-object in
\Websites\Skip\horseshoeengraver.com\www\plugins\system\custom_price_letter_count\custom_price_letter_count.php on line 24Thanks
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183031
by Xavier
Replied by Xavier on topic Count Characters for Automatic Entry of Quantity
Hi,
Please edit the indicated file and replace:
By:
Please edit the indicated file and replace:
Code:
$field = $params->get('field','');
Code:
$field = $this->params->get('field','');
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183126
by jbrandvik
Replied by jbrandvik on topic Count Characters for Automatic Entry of Quantity
Changing the file produces this result.
Thank you
Fatal error: Using $this when not in object context in
\Websites\Skip\horseshoeengraver.com\www\plugins\system\custom_price_letter_count\custom_price_letter_count.php on line 24
Thank you
Fatal error: Using $this when not in object context in
\Websites\Skip\horseshoeengraver.com\www\plugins\system\custom_price_letter_count\custom_price_letter_count.php on line 24 Please Log in or Create an account to join the conversation.
11 years 9 months ago #183190
by nicolas
Replied by nicolas on topic Count Characters for Automatic Entry of Quantity
Hi,
Please install this new version of the plugin and try again. It should work better:
Please install this new version of the plugin and try again. It should work better:
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
The following user(s) said Thank You: jbrandvik
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183197
by jbrandvik
Replied by jbrandvik on topic Count Characters for Automatic Entry of Quantity
Nicolas,
Thank you, once again for the time you have put into working on this. I am sure there will be many others who will be able to use this plugin if they do any custom work.
This version of the plugin does indeed work without throwing any errors. Unfortunately, I still can't use the it because it counts not only the characters typed in the custom field, it also counts blank spaces. Since the intent is to calculate the correct price for the custom lettering engraved on the product, the plugin would charge the customer for each blank space as well. Example,if the client's requested inscription is ALL MY LOVE , the plugin inputs a quantity of 11 instead of the correct quantity of 9.
Thank you, once again for the time you have put into working on this. I am sure there will be many others who will be able to use this plugin if they do any custom work.
This version of the plugin does indeed work without throwing any errors. Unfortunately, I still can't use the it because it counts not only the characters typed in the custom field, it also counts blank spaces. Since the intent is to calculate the correct price for the custom lettering engraved on the product, the plugin would charge the customer for each blank space as well. Example,if the client's requested inscription is ALL MY LOVE , the plugin inputs a quantity of 11 instead of the correct quantity of 9.
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183200
by nicolas
Replied by nicolas on topic Count Characters for Automatic Entry of Quantity
Hi,
Well that wasn't something clearly explained so I went to the simplest.
Here is a new version with an option to list the characters that you want to be excluded from the counting:
Well that wasn't something clearly explained so I went to the simplest.
Here is a new version with an option to list the characters that you want to be excluded from the counting:
This attachment is hidden for guests.
Please log in or register to see it.
Please log in or register to see it.
The following user(s) said Thank You: jbrandvik
Please Log in or Create an account to join the conversation.
11 years 9 months ago #183204
by jbrandvik
Replied by jbrandvik on topic Count Characters for Automatic Entry of Quantity
Awesome! Thank you! This is a good example of why I stay with you guys year after year!
Please Log in or Create an account to join the conversation.
Time to create page: 0.215 seconds