Breaks Theme
-
Hi,
Not sure from which version this is happening, but this plugin breaks my theme. The theme is “The Retailer” from Themeforest.
It seems your plugin puts in div tags that screws up the layouts of the checkout and cart pages.
Not sure how to fix, other than directly editing your code.
-
Since your theme doesn’t have cart.php or checkout.php files hidden away in the /woocommerce/cart and /woocommerce/checkout folders, it’s apparent the theme must be using hooks to reorganize cart and checkout pages. In fact, it might be removing hooked functions entirely and re-writing them. This plugin could still be used, but you’ll need to hire a developer (or find a generous WP developer friend) to move the WC Gift Wrapper hooks to the correct new locations for your theme.
In the end, I’d like to say it’s not WC Gift Wrapper breaking your theme, it’s more like it’s your theme breaking WooCommerce. Bottom line: WC Gift Wrapper is a simple and free plugin designed to work with simple and free themes. Good luck!
Don’t get me wrong, I just don’t understand your answer. If my theme was doing something that is not supported by your plugin, then how does it work at all? If what you’re saying is true, then your plugin couldn’t put anything in the page at all.
Did some more reading thru the code, and speaking to the developers (Getbowtied, The Retailer theme), the theme is not using the cart page as it is only editing the header footer and CSS.
The whole cart table and buttons are coming from the Woocommerce plugin directly.
And after having a look at the default Woocommerce cart.php page gives credence to my fix.
I have been thoroughly reading thru your code, Woocommerce code and theme code.
I can confirm my theme doesn’t do anything at all to the cart. My theme has the header and footer but pulls the cart contents directly using the Woocommerce cart.php template.
Now I know I said before that the </form> tag after removing solved it, but I think I finally worked out why that works. In your code you have:
<form method=”post” action=”” class=”giftwrap_products”>
Now this one is very strange, in the raw source code, the above line shows. In Chrome Developer tools, it’s not there. I believe that dev tools is correct as it then makes sense, that if the <form.. is missing, then the corresponding </form> closes the primary form too early. Hence My “fix”. Also according to standards, you shouldn’t have nested forms.
On top of all that, I tried your plugin without the <form… or </form> tags. I removed them completely and everything is working fine. You have no action assigned to them anyway so I don’t understand why they are even needed.
Offical answer from the Theme Developer:
Hey there,
This is Traian and I am a developer here at GetBowtied. The Retailer actually does not modify the cart or checkout page templates, either by overriding or function/hooks, the aspect of those pages is done strictly by CSS and JS.
I did checkout the plugin you mentioned, looking at the latest version ( 1.3.3 ) I was able to find this in the code:
https://www.screencast.com/t/AJCBlxD5wk
Notice how the “modal-body” div is opened outside the form but closed inside it? And the “modal-footer” div is opened inside the form and closed outside it?
Furthermore if you do a simple validation you’ll notice the mentions of several form/div issues with opening and closing them: https://www.screencast.com/t/8x12QeF3
My suggestion would be that you kindly ask the plugin author to look at fixing those tags and I imagine any layout problems should be fixed. Alternatively you could try to fix these yourself with some custom CSS, there’s no need to do any child theme or in-theme code editing. But in the long run you should get those plugin issues fixed, the issue you are seeing may not be the only one and it may vary depending on browser and how it handles broken tags.I’ll leave you to my colleagues if you have any more questions.
Cheers,
TraianHi there,
Just to let you know, I haven’t forgotten you. I am having to prioritize other projects. But chunks of this plugin are being re-written. Can’t promise you joy on the modal, but some other issues should be fixed. Thank you for all the helpful input. Seems like you should be able to hard-code a fix for yourself in the meantime from all you’ve learned.
Cheers!Have already hard coded a fix for now. Will await an update. thanks.
Can’t be certain version 1.4 will do it for you, but I’ve released it with your feedback in mind. Fingers crossed!
Just done some testing and yes, thank you it has fixed a large number of the issues.
Just a couple of outstanding ones for your reference thou.
1. The Add Gift Wrapping to Order button is in the standard WooCommerce styling. Not sure if its a problem on your end or my theme is missing the CSS for that button, but my theme styles all other buttons in WooCommerce.
2. Laout:
Model +
Before Checkout: Good
Under Coupon Field: Good
Above Totals: There is a very large gap between the form and the Gift wrap text. Can’t find the error yet, but my theme has the items and totals side by side on 1 line. Not room for before totals. So may be my theme.No Model
Before Checkout: Good, shows as a hidden form (if this is normal than rest is not as I don’t get that elsewhere).
Under Coupon Field: Good, shows form directly under the items list (after coupon).
Above Totals: Shows and works, but same issue as above with a large gap between.If I can find what is causing the gap, will let you know.
Thank you for the feedback.
Sounds like at this point you have CSS styling issues particular to your theme. In my testing of about ten different themes, each had its own minor niggling issues, but not something I’m going to go about fixing theme-by-theme and bloating this plugin and making endless work for myself. Each would require one or two lines of custom CSS.
Get your CSS goggles and gloves on! 😛
I think I have shown that my knowledge is enough to fix these last things using CSS, I was more pointing it out to make sure you have your classes set for the buttons according to WooCommerce standards. This way it will take the formatting applied via the Theme automatically.
Thank you for explaining that to me.
The topic ‘Breaks Theme’ is closed to new replies.