Home › Forums › WoodMart support forum › Add coupon feature or show coupon status in WoodMart side cart
Add coupon feature or show coupon status in WoodMart side cart
- This topic has 7 replies, 2 voices, and was last updated 5 months ago by
Artem Temos.
-
AuthorPosts
-
November 19, 2024 at 10:58 am #613283
markusParticipantHello there,
I like it that WoodMart comes with the side cart out of the box, so no need for an additonal plugin. However, a well known additional plugin from Xootix has a very interesting features, i.e. to allow to apply a coupon directly in the Side Cart
https://wordpress.org/plugins/side-cart-woocommerce/
From the plugin description:
> Apply coupons directly from your side cart! View your available coupon codes, and with a single click, watch your discounts apply instantly. Plus, explore a list of upcoming coupons, just a step away from activation, encouraging users to add more to their cart for extra savings.
WoodMart Side Cart is good to have but there are hardly any settings.
Which brings up to major question:
1. Can I / how can I extend the WoodMart side cart? Is there a well known approach you can suggest? Or would it require to overwrite the template file (which file?) or use hooks and shortcodes?2. What if we want to use the mentioned plugin because of the limitation with WoodMart native Side Cart feature? In that case I see the native WoodMart Side Cart as a disadvantage as the chances are higher that complications show up
An alternative to this all would be to just show the status “Coupon successfully applied” as an information only, instead of the entire coupon functionality to actually apply a coupon in the Side Cart
Thanks in advance
best regardsMarkus
November 19, 2024 at 2:59 pm #613417
Artem TemosKeymasterHello Markus,
Thank you for reaching out with your questions regarding the WoodMart side cart.
1. Extending the WoodMart Side Cart: Adding features like applying coupons directly in the side cart would require additional customization, which is not included in the theme’s native functionality. To extend it, you can overwrite the relevant template files or use hooks and shortcodes. If you’d like to proceed, our recommendation would be to consult with a developer to implement these changes effectively.
2. Using the Xootix Side Cart Plugin: While it’s possible to use third-party plugins like Xootix, we cannot guarantee full compatibility with the WoodMart theme’s native side cart. However, you are welcome to try it and test its integration in your setup.Additionally, if you’d like to see features like this natively implemented in WoodMart, we encourage you to post a feature request here: https://woodmart.canny.io/feature-requests
Feel free to reach out if you have any further questions.
Kind Regards,
The WoodMart Support TeamNovember 19, 2024 at 3:30 pm #613448
markusParticipantHi Artem,
Thanks for your reply.
about 1: do you have hints about hooks, usually hooks are prefered way of doing it (instead of customizing the theme). So this would be my first approach, but without documentation I can’t know about the hooks. Can you let me know about those? And as a backup plan about the template file/path as well, please?
about 2: ok, I’ll stay away from it now, it is not my intention to do it this way but would be just good to know
best wishes
MarkusNovember 19, 2024 at 4:56 pm #613482
Artem TemosKeymasterHello,
1. Unfortunately, we don’t have documentation or hints that can help you with this customisation.
Feel free to contact us if you have any further questions.
November 19, 2024 at 5:02 pm #613489
markusParticipantWell, it’s a bit odd … because who in the world could know if not the developer (Xtemos). I don’t think it’s possible to read out hooks myself. Those must be documented, otherwise it’s not possible to learn about those, or am I wrong. If you don’t know it, who would know it?!
Please correct me if I am wrong, but whatever I know about hooks, it must be communicated from the developer.
best regards
MarkusNovember 20, 2024 at 10:03 am #613650
Artem TemosKeymasterMost hooks are provided by WooCommerce plugin and you can try to refer to its documentation. As for WoodMart hooks, you can find them directly in the code using search for keyword
woodmart_
. But there are no hooks in the mini cart widget from our theme that can help you, unfortunately.November 20, 2024 at 10:51 am #613672
markusParticipantI see, meanwhile I found a first workaround to this. This was my reference: https://xtemos.com/forums/topic/add-content-into-cart-sidebar/
This is really only a workaround and not fully solving this. Maybe it’s still of help to others as well.
The workaround shows a static content e.g. “Coupon is added and will be applied in the next step” in the side cart. Dynamic conditions (e.g. from the Dynamic Content for Elementor plugin / dynamic.ooo) allow to show this static text only when an actual coupon is applied from the native WooCommerce coupon feature.
This all makes sense when coupons are added automatically e.g. https://yourshop.com/?coupon=specialdiscount
For instance, you send out a newsletter and include the link that automatically applies the coupon. Then the visitor will be confused, because it does not show anywhere that the coupon is already applied. Only in the last step (cart/checkout) the visitor sees that the coupon is already applied.How to:
1. Create a WoodMart HTML Block in Elementor and add a container + text widget “Coupon is added and will be applied in the next step” to it
2. Apply dynamic conditions to the entire container to load and show it only when an actual coupon is applied. I used dynamic.ooo Dynamic Visibility and added a custom condition to itreturn !empty(WC()->cart->get_applied_coupons());
3. Add the HTML Block to the WoodMart / WooCommerce Side Cart
add_action( 'woocommerce_widget_shopping_cart_total', function(){ echo do_shortcode( '[html_block id="27235"]' ); }, 5 );
The side cart will NOT show the price after the coupon is applied. However, it’ll give at least the information whether a coupon is already applied or not.
If anyone sees it and can use it, I am glad I could help. If anyone has an idea how to improve it, I would be happy to hear about it.
I thought about implementing the actual coupon-functionality into the side cart but could not make that work just yet.
November 20, 2024 at 11:13 am #613683
Artem TemosKeymasterWe are glad that you sorted it out. This topic will remain open if anyone would want to discuss this with you.
-
AuthorPosts
- You must be logged in to create new topics. Login / Register