-
Notifications
You must be signed in to change notification settings - Fork 9
Clarification on which templates can be modified #110
Comments
Hey Greg, Yes at the moment only those four templates are customizable. I made a mistake an accidentally left those old partial files in the plugin which were used for the older 1.x version. With that said, I am planning to release more templates in the near future for version 3.0. I'm hoping to release this in mid-March. Is there anything in particular you'd to see? |
Hi Andrew, So, there is no way to customize the output of products in a loop? For instance, pulling the excerpt for the product instead of the full description, or adding a conditional for changing the button text depending on product tags etc... |
Technically you can do this by fetching products using method's the plugin provides, and then doing what you describe. For example:
The
However, in order to render product components (like the buy button) which work with the cart, you must use the plugin's Render API. So building on the above example, you can then render "buy buttons" for each product like this:
You can see a list of different options for rendering in the docs here: https://docs.wpshop.io/#/render-api/products. Does this help? |
Ok thanks, that clarifies some of it. I hadn't realized you were using react. It makes a bit more sense to me now. To clarify what I am trying to do: I was looking specifically at the "collections-single.php" and "products-all.php". I had a few conditions* I wanted to set on the products list rendered on those templates, but that means modifying the "products" component (which I assume i don't have access to modifying).
Basically I need to create my own products component for the products list and single collection. So I guess the main question is:
e.g.; |
In version
The Let me know if this helps! |
I have tried this a couple of ways:
Both approaches return an empty array. I double checked the collections had content by switching back to your templates. I'm only having this problem on the collections-single.php |
for both method 1 & 2, I get the correct value for the $post_id and the $collection_ids |
The only difference between method 1 & 2 is that method 2 returns an array with a single value for the collection Id Method #1 returns '158055792704' |
Ah, I think I see the issue with 2. Try this:
|
That doesn't work. I still get an empty array. It's the same as I have gotten most of what I need working well in the products-all.php. I'm gonna see if I can build a shortcode using my own template to generate the output I need. Now I just need to get the collections working :) I just wanted to thank you in advance for all the help. |
After some digging and testing I found that the manual collections are syncing to the collects table, but the smart collections are not. |
I recently acquired the pro version.
You documentation states that with the pro version the following templates can be modified when copied to your theme:
Does this mean that only those 4 specific files can be modified, or are the partials in the /wps-templates/components/ also modifiable?
The text was updated successfully, but these errors were encountered: