Support

Home Forums Event Espresso Premium View Cart Button in a Post

View Cart Button in a Post

Posted: February 24, 2014 at 9:49 pm

Viewing 8 reply threads


MsBecca

February 24, 2014 at 9:49 pm

How can I get the “view cart” link in a Post to a change to a button. I was able to get the “Add to Cart” link to change to a button using the following code [ESPRESSO_CART_LINK event_id=”10″ anchor=” direct_to_cart=1 moving_to_cart=”Redirecting to cart…”] but haven’t been able to get the “View Cart” to change to a button. Thanks.


Dean

February 25, 2014 at 4:54 am

Hi,

The shortcode you linked will never show the view cart link as the user is redirected to the cart, unless of course they hit the back button.

To change it, you will need to use CSS. For example:

.ee_view_cart {
padding: 10px;
background-color: orange;
border: #000 1px solid;
border-radius: 10px;
color: #fff;
}

You could also use CSS to repalce the text with an image http://css-tricks.com/css-image-replacement/


MsBecca

February 25, 2014 at 7:31 am

To clarify: Currently, after someone clicks on the “Add To Cart” button in a “Post” the link “View Cart” automatically shows. After an item is added to the cart how would I get the “View Cart” link to show a button instead of a link in a “Post”. I already have the below code in CSS but it only works in the EE Event Description.

.ee_view_cart {
display: block;
text-indent: -9999px;
background-image: url(http://mysite.com/wp-content/uploads/2013/07/View-Cart-2.jpg);
height: 40px;
width: 125px;
}

.ee_add_item_to_cart {
display: block;
text-indent: -9999px;
background-image: url(http://mysite.com/wp-content/uploads/2013/07/Add-To-Cart-5.jpg);
height: 43px;
width: 125px;
}
Thanks.


Tony

  • Support Staff

February 25, 2014 at 7:40 am

Hi,

May I ask where you currently have that CSS?

The code you have posted should work throughout the site.


MsBecca

February 25, 2014 at 7:58 am

The code is currently in the theme’s custom-css file.


Tony

  • Support Staff

February 25, 2014 at 10:34 am

Hmm then that should work fine within Post’s.

Are you running a caching plugin at all?


MsBecca

February 25, 2014 at 11:48 am

No, not that I am aware of.


Dean

February 26, 2014 at 12:44 am

Can you provide a link to an example Post where the view link is not changing please?


MsBecca

February 26, 2014 at 7:22 am

Yes, the link is http://temporaryurl.scripteen.com/il although now when I click on Add To Cart it goes directly to the cart whereas before it would stay on the same page. But the link is above if you want to go ahead and test it. Thanks.


Tony

  • Support Staff

February 26, 2014 at 7:44 am

Automatically redirecting to the cart means the shortcode is using the direct_to_cart attribute. Such as:

[ESPRESSO_CART_LINK direct_to_cart=1 moving_to_cart=”Redirecting to cart…”]

If you remove that attribute the link will no longer re-direct to the cart.

However, I added and event to the cart then clicked the browsers back button to return to the previous part and was shown the ‘View Cart’ image http://take.ms/fQGLS

If you would like to remove the above attribute from the shortcode we can then test again without the re-direct.

Viewing 8 reply threads

The support post ‘View Cart Button in a Post’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso