Something on my site doesnt display until I refres

2019-09-23 11:52发布

问题:

I have this site http://www.taranmarlowjewelry.com/ ....notice when you first goto the site, look at the top right corner....there is nothing there, refresh the page and in the top right corner my shopping cart appears.

My question is why doesnt that appear in the top right corner when I first goto my site and how would I go about fixing this issue....looking for a step in the right direction here.

Thanks, J

I even manually put in the cookie in my theme's functions.php file at the bottom like so...

function set_new_cookie() {
    setcookie("PHPSESSID", '6a52e6037be6342014834c475b6c0637', time()+3600);  /* expire in 1 hour */

}
add_action( 'init', 'set_new_cookie');

it sets it, it doesn't show any errors, but it does not solve my problem.

回答1:

Go into wp-ecommerce/wpsc-includes/shopping_cart_functions.php and adjusting this line

if ( isset( $cart ) ) {
echo wpsc_shopping_basket_internals( $cart, false, true );
}

to this

//if ( isset( $cart ) ) {
echo wpsc_shopping_basket_internals( $cart, false, true );
//}


回答2:

It is because there apparently must be a cookie set in order for the cart to display. If you disable cookies on the site, you can actually prevent the cart from ever showing up.



标签: php wordpress