ResolvedHow to change “Order” Button title on product page using php function
Tagged: order button, Product page, title change
- This topic has 15 replies, 4 voices, and was last updated 2 years, 1 month ago by
Althemist.
- AuthorPosts
- January 26, 2021 at 4:21 am #28483
studio.idwg
ParticipantHello,
I need help with changing the “Order” button title on product page to “Add to Cart” using themes function.php:
Please advise!
Thanks
January 26, 2021 at 7:29 am #28487studio.idwg
ParticipantThis reply has been marked as private.January 26, 2021 at 9:27 am #28492Althemist
KeymasterHello studio.idwg,
1. No need to sue php function for this. Just use Loco Translate and change the text string.
2. Not really sure what do you mean. Could you please explain more?
BTW, there is no need to use the “private reply” feature where there is no sensitive data like login details in the post. The reason we use forum based support system is that other users with similar problems can benefit from already discussed topics. 🙂
Regards,
DimitarJanuary 26, 2021 at 10:55 pm #28517studio.idwg
ParticipantHi Dimitar,
1. Thank you for informing about the Loco Translate app.
2. Here is the link bbq-chicken-pizza product page, where you can clearly see a duplicate product image listed next to the original one. I have noticed that this only happens when one size variation is selected by default on product page.
3. There is also another issue when no pizza size variation is selected by default but the crust options that are free ($0.00) are showing as $1.00 even after selecting a pizza size.
Crunchy Thin and Soft Thin crust options should be free for all sizes, and only Soft Thick crust size price should remain variable based on pizza size selection.Is it possible to change that logic, so that when no pizza size variation is selected by default, the price for the 2 free (Crunchy Thin and Soft Thin) crust options is hidden, and stays hidden after selecting a pizza size variation option?.
Here is the link to the product that I am referring to:
January 27, 2021 at 10:23 am #28524Althemist
KeymasterAccess Denied – GoDaddy Website Firewall
Block reason: Access from your Country was disabled by the administrator.
🙂
January 27, 2021 at 11:35 am #28533Danzso
ParticipantI had the same “problem” with the price. I have a meal deal option, its contains all extra oprion. So its free when you choose this option but display 1.
Check it, now im solve this with some php correction. (option.price): https://piripirimaghull.com/product/chicken-wrap/I will send the code if it possible 🙂
January 27, 2021 at 1:45 pm #28535Althemist
KeymasterAs far as I can see the “regular” variation is set as default variation – e.g. – it’s pre-selected when you load the page. That’s why the addon price is initially set to 1. When you select the meal option it is set to 0, as it should.
BTW, there are quite a lot cookies and session warning on your website and for some reason your addons are displayed 1 per row. Most probably some customization you made is causing this. You can “fix” the addons 2-column layout with CSS. Something like this:
.summary form.cart div.product-addon p.form-row { width: 49.3%; }
What kind of PHP correction are you talking about?
January 27, 2021 at 6:14 pm #28545Danzso
Participant/wp-content/plugins/lafka-plugin/incl/addons/templates/checkbox.php [line 7]
$option_price > 0 –> $option_price > -1/wp-content/plugins/lafka-plugin/incl/addons/templates/checkbox.php [line 33]
data-attribute-prices=”<?php echo esc_attr( json_encode( $attribute_prices ) ); ?>” –> data-attribute-prices=”<?php echo esc_attr( json_encode( $attribute_raw_prices ) ); ?>”I made this changes and its work when the price 0.
(if i change the attributes displays the 0 and the other price) 🙂January 28, 2021 at 9:03 am #28561studio.idwg
ParticipantThis reply has been marked as private.January 28, 2021 at 11:58 am #28515studio.idwg
ParticipantThis reply has been marked as private.January 28, 2021 at 12:35 pm #28569Althemist
KeymasterHello Dave and @Danzso,
Our lead developer Alex and the technical team are checking this now. Will let you know ASAP.
January 29, 2021 at 6:51 pm #28616Alex
KeymasterHello,
We’ve checked and we are able to reproduce the issue on our side.
So when there is variable addon option set to 0, on the frontend the price doesn’t change when choosing this variation.Thanks, Danzso for the proposed fix. We will analyze, test and should be included in our next update soon.
Regards,
AlexJanuary 29, 2021 at 10:14 pm #28617Danzso
ParticipantI’m happy to help you. This fixed function works perfectly on my site. btw. thnanks for this cool theme 🙂
February 1, 2021 at 10:37 am #28628Althemist
KeymasterActually, your fix doesn’t work properly with taxes, so we have improved it further. Update with the new fix will be released later today.
Thanks again for your feedback and your kind words. 🙂
February 8, 2021 at 9:32 am #28757studio.idwg
ParticipantHello, when can I expect the new fix. We are receiving a lot of customer complaints regarding this.
Please advise,
Thanks!
- AuthorPosts
You must be logged in and have valid license to reply to this topic.