Woocommerce Variations Displayed on Archive Pages - php

I've got some code working perfectly on my single product pages. For some reason, it will not function the same in archive/list view.
First, I used a plugin to make the variations radio buttons instead of the dropdown. Then I modified that and made it display the price of each variation. Like I said, works great on product page.
I'm new at this google and compile until my eyes bleed and eventually it works. No such luck this time.
Here is the product page: http://pchdelivery.com/product/star-wars-kush/
Here is archive: http://pchdelivery.com/menu/
I don't need any of the cart functionality, only to display the variations and respective price with each product in categories.
Thanks in advance

As per I can understand the issue, you may need to change the settings from the attribute options for the product where you will have to choose the option to not shown in product archive pages.
Screenshot : http://www.awesomescreenshot.com/image/2352336/b6552a6b4d83f8c16efd5935046728c4
Hope it helps.

Related

Yoast breadcrumbs not displaying correctly on imported WooCommerce products

I am importing products via Product Import Export for WooCommerce by WebToffee, I then have a function that pulls data from an API and populates the data in each imported product.
Everything works perfectly, except Yoast breadcrumbs don't show properly when I view the product. The breadcrumbs on the frontend will say e.g.
Shop » Product Name instead of the full category and sub-category breadcrumb trail.
The only way I can successfully get the breadcrumbs to show properly is by manually editing the product and clicking update, it then shows correctly, as in:
Shop » Workwear » High Visibility » Hi Vis Polo Shirts & T-Shirts » Product Name
This would be fine, except I will be importing thousands of products in one sitting so I need a programmatic solution to add to my function which will make the breadcrumbs display properly on the frontend.
What I've tried so far
In my function I've tried populating the following custom metadata within each product:
_yoast_wpseo_metadesc
_yoast_wpseo_title
_yoast_wpseo_primary_product_cat
_yoast_wpseo_content_score
_yoast_wpseo_estimated-reading-time-minutes
But unfortunately setting all of the above doesn't seem to affect the display of the breadcrumbs.
I've also tried clearing product transients in wp-admin after import and product creation but this didn't resolve the issue.
Any ideas on how I can get this working? Is there a function I can run as part of the WC-Product object which will trigger the breadcrumbs to sort themselves out as it does when manually clicking Update in edit product?
Any help would be greatly appreciated
Well it really depends how you're importing products. Currently, when each product insert, SEO Yoast meta isn't setting up in database so everytime you need to edit and update that product.
The custom meta might also not worked in your case because you're not inserting data in other Yoast table like _yoast_indexable.
Can you show us how you're importing products so we might help you?
Just in case it helps anyone else in the future having the same issue, the problem was due to my code, which modified the category and Yoast primary category after the last execution of wp_update_post.
Simply running wp_update_post( $product_id ) after programmatically updating the category / primary category fixed the malformed breadcrumb issue.

Wordpress: In all products list (Woocommerce) - how to show product description

I have a WordPress Woocommerce webstore with ~ 30K products and not all of them have a description. I need a way to see product description from product listing in WordPress admin panel (doesn't even have to be full description, an except would be sufficient), or at least a way to somehow filter out products that don't have description. I have thoroughly searched for a solution here and on the rest of the web but I can't seem to find an answer. Please help and thanks in advance!
You may try this plugin: https://wordpress.org/plugins/codepress-admin-columns/
it is actually adding new columns to the WP admin panel, and it is said in the description that it integrates with the woocommerce also.
As the other idea, check this tutorial: https://upstatement.com/blog/2014/02/adding-columns-to-the-wordpress-admin-the-easy-way/
I've used that approach to show new columns with content from advanced custom fields plugin, so I guess there should be a way to display WooCommerce info
.

Display Custom Options from Simple Product into Magento 1.9.0.1

I am creating a simple test product in magento and trying to add some custom attributes for variants. Unfortunatly these are not showing up in the front end.
So I'm pretty sure it's a theme issue here...
When I add a custom product option such as a drop down, the Add to Cart button vanished and can no longer be purchased... as well as now showing the dropdown.
Any thoughts would be greatly appreciated. Is there a directory to look this stuff up in?
I've added some photos in case my description wasn't clear enough
Thanks
Try clearing your caches
Check the inventory tab, if product is saleable on frontend (in stock and has qty)
check /var/log/ and /var/report for errors
calling isSaleable() on the product object can direct you as well (this check is also in product actions template where the add to cart button is rendered)
Just a note but if you have product variants (say size) you probably want to use configurable products instead of custom options
I have had same issue in my new magento 1.9
I just clean all caches from var/cache
Also clean your cache from magento admin.

How to customize cart item in magento

How can we customize cart items in magento. I have used custom options but it is not working as intended. All I need is to show some configurable data in cart page and in order page.
Can some one help how can I achieve it.
Edit: To elaborate, along with cart item, type and qty. I want to display supporting text for each item type. I got it working with custom options, but I had to include qty inside custom options which created an issue on cart page during cart update. Now I am looking for some other way by which I can acheive same thing.
Thanks
According to your question, you are trying to edit the product that are in the cart. Hope i am getting you right. For this you just need to have a look at the file default.phtml in
app/design/frontend/base/default/template/checkout/cart/item/default.phtml
This phtml file is responsible for displaying the item in the cart. Here you can get the custom options of the product as well. You can edit as per your requirement.
But remember before you edit copy this file to your theme because this is the best practice not to edit the magento's core files.
Hope this will help.

Product is repeating on next page automatically in magento

Link of my site: http://www.classiquefurniture.com.au/index.php/
I have entered some products in this category: http://www.classiquefurniture.com.au/index.php/bookcases.html but some products are repeating automatically on 2nd page as well but thing is, the product is entered only once in backend. And some product is not displaying on any page.
Now one more strange thing: When I choose option (12 products per page) then some products are not displaying on any page but likewise when I choose (all product in one page) those products are displaying.
I don't know why this is happening. Its really surprising for me. Please help me in this matter.
A simple solution might be to enable the flat product catalog of Magento under System > Config > Catalog > Frontend After reindexing, Magento will use the flat table for the store view on product listing pages on the frontend. It might be that solves the issue already for you. If it doesn't solve your problem, try adding another sorting criteria, for example the entity_id. You can do that using an event observer for the catalog_product_collection_load_before event. ($observer->getCollection()->setOrder('entity_id', 'ASC');).

Categories