WPPizza – A Restaurant Plugin for WordPress › Support › General Support › Can no longer add item by name
- AuthorPosts
- 30 November, 2017 at 3:37 pm #33237
Hi, before we upgraded to version 3 we were able to add an item to the cart by the item’s name. Now, the file we had customized has disappeared and the only way to add an item is to click on it’s price. Can you please indicate how we can change this back to how it was before, if possible? Many thanks!
30 November, 2017 at 3:57 pm #33238what file exactly did you customise (and how)
30 November, 2017 at 4:02 pm #33239PS: this sounds like you have edited corefiles
In case this is what you have done please note: there is no support for editing core files and is entirely at your own risk (and is never a good idea in any case because that’s what filters and actions are for)1 December, 2017 at 2:41 pm #33256Hi Olly, this is what my developer wrote back:
/wppizza/markup/cart/cart.container.php
/wppizza/markup/loop/theme-wrapper.php
We overrode those files with exact same file name in child theme where customization was needed. In future if the plugin structure will change after upgrade then the override files may not work. Also, could not find any filters and actions to add the required code.
The files are there in child theme’s wppizza/markup folder.
If you like, I can get the code that was changed/added from him.
1 December, 2017 at 7:36 pm #33257>/wppizza/markup/cart/cart.container.php
>/wppizza/markup/loop/theme-wrapper.phpthose are – already – v3 files…
must admit , i don’t really understand what the problem seems to be here …2 December, 2017 at 9:22 pm #33278Hi Olly, this is the code the developer added. Should he have done something else?
I have a screenshot from him but cannot upload it.
This is the code:
Code is as below in following files.
1. Following code was added to display breadcrumbs and description in theme_wrapper.php on line 33.
/isladelencanto-child/wppizza/markup/loop/theme-wrapper.php
<p id="breadcrumbs"> <a>">Home</a> >> <a>/menu-online-ordering/">Menu & Online Ordering</a> >> <?php echo single_cat_title(); ?> <?php echo "<div class='at-catdes'>" .category_description(). "</div>";?>
2. Following code was added in cart.container.php to display text and button if no code items were added and if they are closed.
/isladelencanto-child/wppizza/markup/loop/theme-wrapper.php on line 18.
<div class='at-clodes-block'><div class='at-cart'>Your Items : $00.00<br><strong>Total $0.00</strong></div><br><div class='btndiv'><input disabled class='btn btn-primary cart-btn' type='button' value='place your order'><input disabled class='cart-btn wppizza-empty-cart-button btn btn-primary' type='button' value='empty cart'></div></div>
[edit by admin: please wrap code in code tags]
3 December, 2017 at 2:27 pm #33320must admit, i don’t know how this relates to the topic title (“Can no longer add item by name”)…?
anyway, just referring to your last reply here
1. breadcrumbs: wppizza is a custom post type a simple single_cat_title() and category_description() are unlikely to have ever worked there (though there might be some circumstances where this might have worked, but that would be more accidental then anything and pretty much them dependent i would have thought)
i would suggest you have a look here
https://wordpress.stackexchange.com/questions/204738/breadcrumbs-with-custom-post-type-without-plugin
(i might even add a function to the plugin to that effect at some point for convenience)2. all themes are different and i cannot say anything about “line18” there .
essentially , you can do what you want if this works for you, though why you would need any kind of cart thing in the loop template only you will know . of course that might have something to do with your theme and the way it’s constructed3 December, 2017 at 2:34 pm #33321PS
i guess you are/were referencing the wrong file in you second paragraph there(i.e
/isladelencanto-child/wppizza/markup/loop/theme-wrapper.php
on line 18. when you meantwppizza/markup/cart/cart.container.php
)assuming that’s the case, feel free to do what you want there if that works for you
3 December, 2017 at 2:52 pm #33322so , just for the fun of it , i messed around with a couple of things.
and – contrary to what i expected actually –
<?php echo single_cat_title(); ?>
as well as<?php echo category_description(); ?>
works also just fine from what i can see here (at least with the 2016 theme)….dunno
- AuthorPosts
- The topic ‘Can no longer add item by name’ is closed to new replies.