WPPizza – A Restaurant Plugin for WordPress › Support › Feature Requests › Template for Product
- AuthorPosts
- 29 January, 2016 at 9:48 pm #15421
Hi Olly
I’m faced with an issue that I can’t handle in a clever way.
Right now I have 1 page that shows my products with everything included (title, price, content, image, sku)
I’d like to create another page, however this time as an order list page showing all my products, where I only show (Title, Featured Image, Prices, SKU but no Content).
The way I go about it is to hide the content section using css on that page.
However this is not a very good way to do when you have a lot of content (text, images etc) for each product. Although the user does not see it, it still affects the loading time of the page in a big way.A better solution would be if it was not rendered out in the first place.
Would it be possible for you to add a template for a product in the next version of the pizza plugin?
Just like you have done with the email templates, where you can create your own product template and decide what to render.
Thank you
All the best
Jon29 January, 2016 at 11:36 pm #15424it’s a template !
if you want it to do other things, edit it . there are plenty of filters there, or indeed add your own conditionals (based on post_id or whatever)…..do whatever you need (that’s why it actually is a template in the first place).although i *might* one day add some drag/drop builder for this it’s most certainly not going to happen this year
just doing the currently available drag/drop templates for emails/print took months and the basic requirements for those should be pretty much the same for everybodyThe possible ideas one might have as to what the loop should look like are – quite literally – endless.
Building some admin drag/drop thing for this will only result in people asking for more and more things and is – essentially – pretty pointless.( Re-reading the above – I don’t actually think this kind of drag/drop for loops/item lists will actually ever happen. Though never say never….)
29 January, 2016 at 11:37 pm #15425PS: I totally agree that css is not what you want to use for hiding things here !
30 January, 2016 at 11:04 am #15426Hi Olly
Thanks for your reply.
I think I might have not been good enough to explain my idea.
I know that you’re probably using a template already that I could edit – however if you make an update at some point, there is the risk that it could be overridden or things have changed.
I’d much rather prefer that you control everything in the source code than me, because you’re the author and I respect your work šIt’s not the drag/drop functionality that I would like for product rendering but more a shortcode expansion of what you already have started.
Here is an example:
[wppizza category='!all' title='1' featuredimage='1' sku='1' price='1' content='0']
This would allow you to control what is rendered on specific pages.
————-
A more flexible way which would allow to control the markup and any styling adjustments:
[wppizza category='!all'] <div class="product-item"> <h3>[field title]<h3> <label class="sku">[field sku]</label> <label class="price">[field price]</label> <img src="[field featuredimage]" /> </div> [/wppizza]
————
The last solution which would be awesome, would be to not place the markup directly in the page, but under “templates” and simply refer to the name of the template on the page.
So on the page you would simply use:
[wppizza category='!all' template='My Template']
Now in the pizza plugin, for example under Templates, you could click “Add template” and have a simple rich text editor where you insert the markup.
You give it a name “My Template” and insert the markup in the rich text editor:
<div class="product-item"> <h3>[field title]<h3> <label class="sku">[field sku]</label> <label class="price">[field price]</label> <img src="[field featuredimage]" /> </div>
What do you think of this. Would it be a daunting task or is it possible for you to create?
All the best
Jon31 January, 2016 at 4:06 pm #15450there are various issues here:
a) yes, i did have a think about adding some sort of loop/item template editing in the past and something might make it into wppizza v3 (which I am doing at the moment). And perhaps something like adding
template_type=default template_id=3
to the shortcode might be doable…that will become clearer at the time.
That said, there always tend to be some surprises when one is actually doing things that suddenly make options that seemed good ideas in theory, impractical in practice. We will see on thatHowever:
b) adding a textarea where you can add some html which then wraps some other html not only seems strange to me (why not just edit the underlying template in the first place )
but will also not work as I believe you think it works as – in the case of the default layout for example – there is a lot of nesting of elements going on. Not to mention that SKU’s are dynamically generated and inserted. (amongst a bunch of other things ) .
Maybe you want to use the grid template to start off with though, where the sections are quite distinct, and edit that one.
Furthermore, there are already an absolute ton of classes and id’s added you could be using to do your layout as opposed to wrapping elements in yet more elementsc)
Iād much rather prefer that you control everything in the source code than me
Me too, but if you want to customize things for your “one-off” scenario than that’s something that you have to do
d)
there is the risk that it could be overridden or things have changed.
ignoring here wppizza v3 (a lot will change there , but there will be ample warning when we get there and is months away yet anyway).
Why would there be a risk that stuff gets overwritten (assuming you are not editing corefiles which you should not be doing of course)?I thinks that’s it for the moment from me here in a “off the top of my head” kind of way
1 February, 2016 at 11:55 pm #15502Thanks very much for your reply š
- AuthorPosts
- The topic ‘Template for Product’ is closed to new replies.