- This topic has 1 reply, 2 voices, and was last updated 14 years, 3 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Always display product in Cart
Tagged: always display product, default product
I happen to sell just one product, this is why having the product always on the Cart makes sense.
Searched in forum for some thread with this didn’t find any.
This is a simple edit that I think should be very useful having on the Settings tab for eStore. A lot of people have just one product, or may want to have their main product on the Cart as default.
Thanks
You can add something like the following in the “wp_eStore1.php” file (towards the end of the file). The idea is to automatically add the product if the cart is empty:
if (!digi_cart_not_empty())
{
$products = array();
$product = array('name' => stripslashes('Test Product'), 'price' => '10.95', 'quantity' => '1', 'shipping' => '0', 'item_number' => 'product id', 'cartLink' => 'url-of-this-product-page');
array_push($products, $product);
sort($products);
$_SESSION['eStore_cart'] = $products;
}
You will need to put the product details of your product in this line:
$product = array('name' => stripslashes('Test Product'), 'price' => '10.95', 'quantity' => '1', 'shipping' => '0', 'item_number' => 'product id', 'cartLink' => 'url-of-this-product-page');
I haven’t tested this code so there might be errors in it.