Adding a shopping bag to a website

A shopping bag helps customers see how many items they’ve added to their order and proceed to checkout. When you embed your online store, separate products, or Buy buttons to a website, the shopping bag icon will appear on that page automatically as soon as at least one product is added to the cart.

You also have an option to add an additional shopping bag to other pages on your website or put it in the website header. This icon will let website visitors know that you have an online store where they can shop. Also, you can modify the design of the shopping bag: choose the icon, the info to display (number of items, subtotal, etc.), set the position where it will display, etc.

image3.png

Adding a shopping bag to a website

You can add a shopping bag to your website pages so that customers can go to the cart page from any page on your website. Also, a shopping bag icon will remind customers that they’ve added products to their cart encouraging them to complete the purchase.

To add a shopping bag to website pages:

  1. Go to your store admin → Website.
  2. Scroll down to the "Add your store to one more website" section and click Pick Platform → Other platforms and sitebuilders.
  3. Click Add shopping bag. The shopping bag code for your store will be copied to the clipboard.
  4. Go to your website editor and open the page where you want to add the shopping bag.
  5. Paste the code to the source code of the page. That may be HTML or source tab or a separate button to add codes. That varies depending on the website builder you use.
  6. Save and publish the page changes.

The additional shopping bag icon will appear on your website.

Customizing shopping bag design

You can customize the design of the shopping bag to make it match your website design better. To change the default shopping bag design, you need to change the default code of the shopping bag and add a new piece of code that will make the desired change. You will see the codes for different design changes below.

To change the design of your shopping bag icon:

  1. Select the desired design change below.
  2. Copy the code under the desired design change.
  3. Replace VALUE with one of the suggested values and STORE_ID with the ID of your store that you can copy in your store admin, in the bottom left corner.
  4. Go to the editor of your website and open the page where you want to add the shopping bag.
  5. Paste the code to the source code of the page. That may be HTML or source tab or a separate button to add codes. That varies depending on the website builder you use.
  6. Save and publish the changes.

Layout

Value Layout
SMALL_ICON shopping-bag-small-icon.png
SMALL_ICON_COUNTER shopping-bag-small-icon-counter.png
COUNTER_ONLY shopping-bag-counter-only.png
TITLE_COUNTER shopping-bag-title-counter.png
MEDIUM_ICON_COUNTER shopping-bag-medium-icon-counter.png
MEDIUM_ICON_TITLE_COUNTER shopping-bag-medium-icon-title-counter.png
BIG_ICON_TITLE_SUBTOTAL shopping-bag-big-icon-title-subtotal.png
BIG_ICON_DETAILS_SUBTOTAL shopping-bag-big-icon-details-subtotal.png

 

Here is a code to change the shopping bag layout:


<div data-layout="VALUE" class="ec-cart-widget"></div>
<div><script data-cfasync="false" type="text/javascript"
src="https://app.shopsettings.com/script.js?STORE_ID&data_platform=code"charset="utf-8"></script>
<script>Ecwid.init();</script>
</div>

where:

VALUE is the name of the layout that you want to apply to your shopping bag icon. Copy it from the left column in the table above.

STORE_ID is the ID of your store that you can copy in your store admin, in the bottom left corner.

Icon

Value Icon
BAG shopping-bag-bag.png
CART shopping-bag-cart.png
BASKET shopping-bag-basket.png

Here is a code to change the shopping bag icon:


<div data-icon="VALUE" class="ec-cart-widget"></div>
<div><<script data-cfasync="false" type="text/javascript"
src="https://app.shopsettings.com/script.js?STORE_ID&data_platform=code" 
charset="utf-8"></script>
<script>Ecwid.init();</script>
</div>

where:

VALUE must be replaced with BAG, CART, or BASKET depending on what icon you want to use.

STORE_ID is the ID of your store that you can copy in your store admin, in the bottom left corner.

To add a custom image as a shopping bag icon, use this code:


<div data-custom-icon-url="VALUE" class="ec-cart-widget">
</div><div><script data-cfasync="false" type="text/javascript" src="https://app.shopsettings.com/script.js?STORE_ID&data_platform=code" charset="utf-8"></script><script>Ecwid.init();</script>
</div>

where:

VALUE is either a URL to the custom icon file or an SVG markup. To get an URL to your icon, upload your image to any image hoster where you can get a direct link to an image.

STORE_ID is the ID of your store that you can copy in your store admin, in the bottom left corner.

Border shape

To change the shape of the border around the shopping bag icon, use this code:


<div data-fixed-shape="VALUE" class="ec-cart-widget"></div>
<div><script data-cfasync="false" type="text/javascript"
src="https://app.shopsettings.com/script.js?STORE_ID&data_platform=code" 
charset="utf-8"></script><script>Ecwid.init();</script>
</div>

where:

VALUE must be replaced with NONE for no border, RECT for a rectangle border, or PILL for a rounded rectangle border.

STORE_ID must be replaced with the ID of your store that you can copy in your store admin, in the bottom left corner.

Position

 

Parameter Value Description
data-fixed TRUE / FALSE Makes the Shopping Bag stick to a specific place within your pages
data-fixed-position TOP_LEFT / TOP_RIGHT / BOTTOM_LEFT / BOTTOM_RIGHT Pins the Shopping Bag to the screen making the icon follow as you scroll through the page
data-horizontal-indent Positive integer including zero Defines the horizontal margin between the Shopping Bag widget and the edge of the screen or an iframe container
data-vertical-indent Positive integer including zero Defines the vertical margin between the Shopping Bag widget and the edge of the screen or an iframe container

Here is a code to change the shopping bag position:


<div data-fixed="VALUE" 
data-fixed-position="VALUE"
data-fixed-shape="VALUE"
data-horizontal-indent="VALUE"
data-vertical-indent="VALUE" class="ec-cart-widget"></div> <div> <script data-cfasync="false" type="text/javascript" src="https://app.shopsettings.com/script.js?STORE_ID&data_platform=code" charset="utf-8"></script><script>Ecwid.init();</script></div>

where:

VALUE must be replaced with one of the values from the table above depending on what position you want to apply to your shopping bag.

STORE_ID must be replaced with the ID of your store that you can copy in your store admin, in the bottom left corner.

Animation

You can show or disable the animation effect when an item is added to cart by using the following code:


<div data-show-buy-animation="VALUE" 
class="ec-cart-widget"></div>
<div><script data-cfasync="false" 
type="text/javascript" 
src="https://app.shopsettings.com/script.js?STORE_ID&data_platform=code" 
charset="utf-8"></script><script>Ecwid.init();</script>
</div>

where:

VALUE must be replaced with TRUE for showing the animation or FALSE for disabling it.

STORE_ID must be replaced with the ID of your store that you can copy in your store admin, in the bottom left corner.

Use the same shopping bag design on all devices

The shopping bag icon adapts to the screen width and may look differently on devices with different screen width. To force the shopping bag to use the same design on all devices, use this code:


<div data-responsive="VALUE" 
class="ec-cart-widget"></div>
<div><script data-cfasync="false" 
type="text/javascript" 
src="https://app.shopsettings.com/script.js?STORE_ID&data_platform=code" 
charset="utf-8"></script><script>Ecwid.init();</script>
</div>

where:

VALUE must be replaced with TRUE for the cart to automatically adapt to different screen sizes or FALSE for the cart to have the same design on different screen sizes.

STORE_ID must be replaced with the ID of your store that you can copy in your store admin, in the bottom left corner.

Was this article helpful?
0 out of 0 found this helpful