WPPizza – A Restaurant Plugin for WordPress › Support › General Support › Custom product availability
- AuthorPosts
- 1 February, 2016 at 11:32 am #15477
I’m setting up a site for a restaurant with 2 locations. They serve pizza mostly, but one location also offers burgers. Is there a way to set that somehow?
1 February, 2016 at 11:38 am #15487then they are – effectively – two different sites (not only regarding items, but also addresses etc)
you could however use two categories . one for location A one for location B, but in the long run you might find that there will be more differences than just the menu, so personally I would setup 2 sites (in a multisite setup probably)22 February, 2016 at 12:07 am #16017another angle is with products (or in my case, offers) that are only available for either delivery or pickup.
For example, a special offer of a pizza with 2 toppings is only available for store pickup.22 February, 2016 at 12:37 am #16018you can set offers (i.e discounts) of that kind with this
https://www.wp-pizza.com/downloads/wppizza-coupons-and-discounts/
i.e apply discount of x if pickup , otherwise do not apply discount…14 March, 2016 at 2:39 pm #16542I’m trying to write a js/jquery function to uncheck AND hide the delivery checkbox when certain products are in the cart/added to the cart. Any tips on how to trigger it?
with $(document).ready it only updates when the page is refreshed.What I’m trying to accomplish is to disable the delivery option on certain products.
I’ve set the product numbers manually in an array in the js.var checkDelivery = (function() { jQuery('div.wppizza-order-pickup-choice > label').css('display','none'); jQuery('#wppizza-order-pickup-sel').css('display','none'); var a = ['408', '411', '412', '413', '414']; for (index = 0; index < a.length; ++index) { item = a[index]; if(jQuery('.wppizza-cart-contents li[id^=wppizza-cart-item-'+item+']').length > 0 || jQuery('#wppizza-cart-contents li[id^=wppizza-cart-item-'+item+']').length > 0) { //it is in cart jQuery('#wppizza-order-pickup-sel').prop('checked', false); jQuery('div.wppizza-order-pickup-choice > label').css('display','none'); jQuery('#wppizza-order-pickup-sel').css('display','none'); } } });
14 March, 2016 at 2:59 pm #16543just unchecking and hiding the checkbox does nothing. that value must be submitted to affect the calculations (unless in your case absolutely all values that are affected by pickup or delivery are the same).
generally speaking – not knowing your exact scenario though – i would think your answer is in your own question
> ………… how to trigger it? ……………..< http://api.jquery.com/trigger/16 March, 2016 at 1:20 pm #16590That I know already, what I’m wondering is on which event I should trigger. I want it to trigger when an item is added to the cart
it’ll then check if the item is not available for delivery
if so, check if the delivery checkbox is checked
if so, uncheck the box and submit the changeon reload, because of the submission, the page will hide the delivery option if an item is in the cart which does not allow for delivery.
16 March, 2016 at 1:43 pm #1659717 March, 2016 at 12:07 pm #16612Alright, to get going, I copied the suggested code, verbatim – but I am not getting anything in the console as the code orders, like it’s not loading the code at all.
According to the suggested code, it should return “do stuff” and the contents of the cart variable, but it returns nothing.Try here: http://castello.is/matsedill
17 March, 2016 at 1:06 pm #16614i updated the code (was missing the line that actually instanciated the class)
17 March, 2016 at 2:48 pm #16616Thank you sooo much! it’s working now.
- AuthorPosts
- The topic ‘Custom product availability’ is closed to new replies.