Forum Replies Created
-
AuthorPosts
-
so, whilst currently adding some other options to that extension, I also had a think about whether it would be possible (or advisable) to integrate something that let’s you do this sort of thing you mentioned.
In short, although this would most likely be doable programmatically it would just confuse the hell out of people (and that’s not only the admin who would have to set this up but customers too I think)
It did however occur to me, that there is actually quite an easy answer to this I believe
As i understand it a “smos hesp & kaas” has the following
lettuce, tomato, cucumber, sliced egg and mayonnaise – and in this case cheese too.
so , as a customer if i want one of those i don’t expect to actually have to add those ingredients/toppings myself (otherwise it would just be some bread and I choose what i want on it)
so instead of preselecing things (which then would appear in this list of added toppings which as a customer would confuse the hell out of me ) I would make a list of DE-selecting things.
so add the following ingredients
no lettuce,
no tomato,
no cucumber,
no egg
no mayonnaise
no cheeseset the prices for those to zero (hey , you could even make them negative if it’s supposed to become cheaper if you omit some)
then put those in a group naming it “dont want these ?” (or something)
select the following group type:
“Group must have *AT LEAST* minimum number of ingredient selected below (multiple allowed – but no more than 1x per ingredient)”set minimum and maximum to 0
and then assign it to the “smos hesp & kaas” menu item
now only when a customer selects one of these (i.e says “no cheese” for example) will it show up in the list of “added” ingredients as “no cheese”…..
PS: i would also assume that the menu item itself in the description already states that it has lettuce,tomato,cucumber,egg ,mayonnaise and cheese , just like any dedicated pizza napoli for example says :olives, tomatoes , mozarella etc (or whatever belongs onto a pizza napoli)
> Is there a way to do this?
out of the box so to speak: no (not at the moment anyway)
however , you could use some filters and action hooks
these 2 in combination https://support.wp-pizza.com/topic/filter-options/ should let you do that
you would probably have to dynamically set this $option “order_pickup” in the “wppizza_filter_order_summary_options” filter dynamically as well as deciding what to do depending on what items the user has added to the cart(session) with this filter “wppizza_filter_order_summary_session”
all fine and working here…
by the way , you can probably just ignore what i said about that script above
probably was just an overlap in between you clearing the cache and me taking out that script and it suddenly working> Did you just remove an insert
i didnt do anything (other than trying to figure out what the deal is)
i assume it was a caching issue (my best guess here)nothing wrong with caching things (in fact i’m all for it) but you should really clear any caches after plugin updates (in fact the caching plugin should actually alert you to that fact)
now i see you cleared the cache , seem to work fine now , no ?
ok, your issue seems to be here:
something somewhere inserts this (i’ll have a look in a minute why that may be , but just posting this first):
<script> var getElementsByClassName=function(a,b,c){if(document.getElementsByClassName){getElementsByClassName=function(a,b,c){c=c||document;var d=c.getElementsByClassName(a),e=b?new RegExp("\\b"+b+"\\b","i"):null,f=[],g;for(var h=0,i=d.length;h<i;h+=1){g=d[h];if(!e||e.test(g.nodeName)){f.push(g)}}return f}}else if(document.evaluate){getElementsByClassName=function(a,b,c){b=b||"*";c=c||document;var d=a.split(" "),e="",f="http://www.w3.org/1999/xhtml",g=document.documentElement.namespaceURI===f?f:null,h=[],i,j;for(var k=0,l=d.length;k<l;k+=1){e+="[contains(concat(' ', @class, ' '), ' "+d[k]+" ')]"}try{i=document.evaluate(".//"+b+e,c,g,0,null)}catch(m){i=document.evaluate(".//"+b+e,c,null,0,null)}while(j=i.iterateNext()){h.push(j)}return h}}else{getElementsByClassName=function(a,b,c){b=b||"*";c=c||document;var d=a.split(" "),e=[],f=b==="*"&&c.all?c.all:c.getElementsByTagName(b),g,h=[],i;for(var j=0,k=d.length;j<k;j+=1){e.push(new RegExp("(^|\\s)"+d[j]+"(\\s|$)"))}for(var l=0,m=f.length;l<m;l+=1){g=f[l];i=false;for(var n=0,o=e.length;n<o;n+=1){i=e[n].test(g.className);if(!i){break}}if(i){h.push(g)}}return h}}return getElementsByClassName(a,b,c)}, dropdowns = getElementsByClassName( 'dropdown-menu' ); for ( i=0; i<dropdowns.length; i++ ) dropdowns[i].onchange = function(){ if ( this.value != '' ) window.location.href = this.value; } </script>if i take this out , it works just fine…..
the update should not have affected anything on that front ( i downgraded here to the version you have and there are no ill effects)
can you turn off the caching for the moment and let me know when you have done so ? (will at least circumvent one possible issue – although this shouldnt have anything to do with it , but worth a shot for starters)
also , which version did you update from btw ? (if you remember)
looking at it.
throws a javascript error, but right now not sure where its coming from
(says something likeUncaught TypeError: object is not a function
somewhere here it seems(function(term
/**/) {
return wppizzaCartCommentToggle(term);
})not sure why (did you add/edit any js anywhere ?
could you also – at least once now – clear the cache on that page ?good stuff
feel free to post a review though :)
i could do with some more (positive ones of course)not really, no
are you sure you added it to the right functions.php file ?ps: why did you mark your question as private ???
>Thanks a lot, and I will have a try.
by all means of course, but if you give me a couple more days (just testing an additional option to make sure nothing else breaks) i’ll release an update and show you how you could set this up with your original requirements
ps: dont ever hack any core files (unless they are specifically designed to be edited by – usually – copying them elsewhere and edit those copies).
you will never be able to update anything anymore without loosing all your changesthats what filters and actions are for
>Besides, will you implement the sorting function on showing menu items of a category?
no, because that’s not a plugin issue/function/option but down to wordpress
> I found it needs to change the time one by one to make it in sequence.
whats wrong with using the order attribute ? (you can even get there from quickedit)
> And Could you tell me which file and statemnet I can directly modify to make it sorting by item name in ASC or DESC?
as i mentioned, that’s down to wordpress, but – in any case – there are plugins that let you also do a simple drag and drop
this one does a fine job in my experience:https://wordpress.org/plugins/intuitive-custom-post-order/actually – as i understand you – you are trying to chain things i.e have a nested hierarchy like this (omitting drinks here for the moment)
menu item [a]: breakfast
-sandwich with one ingredient
–choose 1 ingredient of the following:x,x,x,x
-sandwich with two ingredients
–choose 2 ingredients of the following:x,x,x,xso sandwich is one ingredient really and the ingredients for that are essentially ingredients for an ingredient …. hope that makes sense)
whereas what is is designed to do is this (i.e :
menu item [a]: sandwich with one ingredient
– choose your one ingredientmenu item [b]: sandwich with 2 ingredients
– choose your 2 ingredientswhich you should be able to do quite easily.
having said that. you could also do your thing by duplicating ingredients and then have those duplicates in their own 2 custom groups (first one being the free ones, second one being the ones with an additional charge of 2.00 , where in both groups you can only select one )
However, ignoring all of the above and given that i have also found a couple of minor bugs whilst messing around – i think I should be able to add something to the plugin that lets you do this more elegantly without having to duplicate ingredients….
give me a few days and there should be an update to the plugin and i’ll post a screenshot here how to set it up
hope that helps (?)
v1.1.1 addresses this now by loading that text dynamically via ajax if using a cache plugin instead of inserting it onto the page
(note: “i am using a cache plugin” has to be checked in wppizza->settings)havent forgotten you
just busy
i’ll see what i can put togethersimple issue is , that the pages are cached (i.e you “recently” turned on a caching plugin)
the current preorder plugin doesn’t deal with that , but i’ll do something in an update that should address that toowill take a few days, so in the meantime taking that text out as you did is probably a good idea (or you could disable your cache plugin of course as a temporary measure)
-
AuthorPosts