genny3021
Forum Replies Created
-
Forum: Plugins
In reply to: [WP eCommerce] No products displayed in products page to a visitorThanks.
I just deactivated and activated the plugin.
Here’s a screenshot of the admin products
https://www.dropbox.com/s/zxom8565m3iun8d/new_products_page.PNG?dl=0Here’s a screenshot of the page where the products are displayed.
https://www.dropbox.com/s/yri7l4jk8ynzrer/products_page.PNG?dl=0The shortcode is [productspage]
Forum: Plugins
In reply to: [WP eCommerce] No products displayed in products page to a visitorHello Mihai, thanks alot for the support so far, i have taken screen shots of some of the pages.
https://www.dropbox.com/s/tntjn4mmaj1bg5k/blank_products_page.PNG?dl=0
https://www.dropbox.com/s/rd6ztc5vovk2zai/admin_products_page.PNG?dl=0
I traced the error being rendered to the products page to wp-content/themes/mytheme/wpsc-products_page line 228
<?php if(wpsc_product_count() == 0):?>
<h3><?php _e(‘There are no products in this group.’, ‘wpsc’); ?>I modified that section of code to
<?php if(wpsc_product_count() == 0):?>
<h3><?php _e(‘There are no products in this group.’, ‘wpsc’);
var_dump($wp_query); /*I saw at the top the page $wp_query is a global variable*/
?>
Here’s a screen shot of the dump
https://www.dropbox.com/s/8nn47i59k78w8ih/query_dump_products_page.PNG?dl=0From the dump, i extracted the request:
[request] => ‘SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_parent = 0 AND wp_posts.post_type = ‘wpsc-product’ AND ((( ( ( ( ( ( ( ( ( ( wp_posts.ID IN ( SELECT tr.object_id FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN (‘3’, ‘4’, ‘5’, ‘6’, ‘7’) ) ) ) ) ) ) ) ) ) ) AND wp_posts.post_status = ‘publish’ ))) ORDER BY wp_posts.ID ASC ‘When i ran the above query in my db, i got no result. That is how i came of the conclusion that the “wp_term_relationships” table is not properly populated when a product is created.
Please note: I traced the function wpsc_product_count to its declaration on
wp-content/plugins/wp-e-commerce/wpsc-includes/product_template.php line 1678
function wpsc_product_count() {
global $wp_query;
return count($wp_query->posts);
}Please, I really do need some help here.
Forum: Plugins
In reply to: [WP eCommerce] No products displayed in products page to a visitorThat’s my dilemma, they are all published. The site is still in production on my local system else i would have gladly posted a url.
Forum: Plugins
In reply to: [WP eCommerce] No products displayed in products page to a visitorYes products are created from the admin products page. However, after i log out of the wp-admin and view the products page(holding the shortcode), i get the message “There are no products in this group.”.
However, if am logged into wp-admin, and view that same products page, i see the products.
Forum: Plugins
In reply to: [WP eCommerce] No products displayed in products page to a visitorPlease any help would be appreciated. Upon investigation i discovered that for a product to be displayed the wordpress table “wp_term_relationships” has to be populated with the appropriate values before products are displayed.
Here’s the query that is used to get the products to the product page:
SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_parent = 0 AND wp_posts.post_type = ‘wpsc-product’ AND ((( ( ( ( ( ( ( ( ( ( wp_posts.ID IN ( SELECT tr.object_id FROM wp_term_relationships AS tr WHERE tr.term_taxonomy_id IN (‘3′, ‘4’, ‘5’, ‘6’, ‘7’) ) ) ) ) ) ) ) ) ) ) AND wp_posts.post_status = ‘publish’ ))) ORDER BY wp_posts.ID ASC ”
When i manually updated the “wp_term_relationships” table with the appropriate post and term ids, the products became visible without been logged in.
If someone could direct to where exactly in the plugin code i can edit to ensure that table is populated dynamically, i would be highly grateful
Thanks