I'm planning a WooCommerce plugin which should override the default shop page "product grid" with my own (a masonry grid with custom styling, pagination and filters).
I see that many developers include template pages in their plugins (archive-product.php) to customize the shop loop output; is this the only way to do it?
I'm asking because I would let the user to customize his grid in WP admin screen (you know, changing columns count, products per page, load-more button/infinite scroll, etc).
Thanks in advance.
To answer your question, it's not the only way. You can also register your own custom template in your plugin, which can be called pretty much anything.
Related
I'm currently working on a product page in Wordpress.
The current theme I'm using allows my product image to be sticky throughout the webpage browsing.
However, the "Add to cart" and a "Price table" is located all the way at the bottom of the page.
I'm looking for a way to change that block over to underneath my sticky product image, so people could constantly see the price changing as they're choosing their options in the page.
I'm currently using Metro as a theme as YITH WooCommerce Add-ons & Extra Add-ons to display my product options.
Appreciate all the help I could get!
Image at the bottom of the product page
I've tried to look for the specific block on the Parent Theme of Metro and I've came to a conclusion:
I don't understand PHP enough to identify the exact block that's calling the price table & add-to-cart button.
Even if I thought I found something that could be it, I tinkered with the codes a bit, but there were absolutely no changes to the site, which led to my assumption that I'm editing the wrong one due to the different layouts the theme has.
I'm struggling with something specific to elementor I believe. I'm trying to generate a different product grid thumbnail size on one particular category page. The category page is however not the standard woocommerce page but an Elementor template. I've tried a number of PHP/WordPress functions in functions.php but I was not able to check whether I'm on the particular category page or not. The logic was - if category x is currently displayed use thumbnails of a different size.
Do you have any ideas how I can achieve this? I think the usual functions don't work because it is an elementor page. I couldn't even grab the post id so that I can make an if statement based on it...
Maybe the questions is just broader - How can one work with functions.php and Elementor at the same time?
I followed this example I found: https://wordpress.stackexchange.com/questions/131358/how-to-change-the-thumbnail-size-to-a-specific-category but I couldn't get it to work or anything similar.
I believe changing the thumbnail size would not be a problem. The challenge is how to do that only for one particular elementor template.
Because of lazy, i don't install woocommerce in my test site for the guide video here. That why i used posts instead.
Your case, my friend. If you install woocommerce, in the elementor pro theme builder will have two tabs for products as image below. Please use Single Product and Products archive template:
And to change the grid query from posts to products. In the posts setting, query section - change source into products (if you want to only show the products in certain category, then set include by term and select the product category you want to display as below image):
I have a question about the Woocommerce product edit page within the admin area. Is it possible to add some sort of next/previous links inside? With a functions.php hack for example or plugin?
Woocommerce product edit page
We have a lot of products and it was convenient if we could navigate to the next without leaving the edit page.
I think this can help you achieve your goal:
https://developer.wordpress.org/reference/functions/add_meta_box/
https://codex.wordpress.org/Plugin_API/Filter_Reference/attachment_fields_to_edit
By adding a meta box you'll be able to display a group of links that will redirect to the next and previous products
Sorry I can't provide an exact snippet that would work, but I hope you can research around the notes I gave you if you find them useful.
Good luck!
I'm using Hellowired theme of magento and I'm trying to display Product attributes on the product page but it is not at all visible except Product description. I want to display tabs like 'product description' in 5 or 6. Is there any way to easily do this without going into code? or if I really want to use coding, then how?
In the Magento admin (Catalog->Attributes->Manage Attributes), ensure that the product attributes you want to display are set to 'Visible on Product View Page on Front-end'.
Then you need to hope that your theme is programmed to display them all. If it isn't then the only way is using code.
To use code, you will need to edit your theme's file:
app/design/frontend/yourtheme/default/template/catalog/product/view.phtml
If you have never coded a Magento theme before you may want to do some research into Magento's theme structure, seek some tutorials on 'local.xml' and if you want to understand what is really going on then work through every line of code in Alan Storm's book 'No Frills Magento Layout'.
I'm looking for the way to add a custom tab in the backend product page, and then display a product grid like Upsell or related product tabs usable by my custom extension.
Thank you for your replies !
Alex
(France)
One way to do this is with product attributes, but I don't think it will let you add a grid. You're going to probably have to start overwriting core Blocks, using Magento's overwriting mechanisms.