Tips and Tricks HQ Support

Support site for Tips and Tricks HQ premium products

  • Home
  • Contact Us
  • Documentation
  • Forum Home
    • Forum
    • Forum Search
    • Forum Login
    • Forum Registration

Always display product in Cart

by

Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › Always display product in Cart

Tagged: always display product, default product

  • This topic has 1 reply, 2 voices, and was last updated 15 years ago by amin007.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • May 12, 2010 at 3:26 am #1189
    yokandesh
    Member

    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

    May 12, 2010 at 9:29 am #20438
    amin007
    Participant

    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.

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Forum Related

  • Forum Home
  • Forum Search
  • Forum Registration
  • Forum Login

Support Related Forms

  • Contact Us
  • Customer Support
  • Request a Plugin Update
  • Request Fresh Download Links

Useful Links

  • Plugin Upgrade Instructions
  • WP eStore Documentation
  • WP eMember Documentation
  • WP Affiliate Platform Documentation
  • Tips and Tricks HQ Home Page
  • Our Projects

Quick Setup Video Tutorials

  • WP eStore Video Tutorial
  • WP eMember Video Tutorial
  • WP Affiliate Platform Video Tutorial
  • Lightbox Ultimate Video Tutorial

Our Other Plugins

  • WP Express Checkout
  • Stripe Payments Plugin
  • Simple Shopping Cart Plugin
  • Simple Download Monitor

Copyright © 2025 | Tips and Tricks HQ