Change cart page redirection URL

Lisa_Dudley
Tourist
26 0 2

Hello,

 

When somebody clicks on the "retourner sur mon site" button on the cart page of my store https://ciaooo.today/cart they are redirected to a collections page. How can I change this to redirect to the home page? 

 

Kind Regards,

 

Lisa

0 Likes
Guleria
Shopify Partner
1476 304 421

Hello Lisa,

Go to Themes -> Edit Code-> Templates -> Cart.liquid
If there is sections then check in Under Section -> Cart.liquid 
Search for 'continue_shopping' and change value in href  ( /collections/all ) to ( / )
Please check screen-shot
cart.PNG

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
Lisa_Dudley
Tourist
26 0 2
Thank you for the response!

Ìm my theme there is no 'continue_shopping', I have this code:

{% for item in cartItems %}


{% assign itemImage = true %}
{% if item.image == blank and item.product.featured_image ==
blank %}
{% assign itemImage = false %}
{% endif %}

data-cart-item-background-image data-cart-item-href>






data-cart-item-href data-cart-item-title>{{ item.product.title }}


data-cart-item-variant-title>
{% unless item.product.has_only_default_variant %}
{% unless item.variant.title == 'Default Title' %}
{{ item.variant.title }}
{% endunless %}
{% endunless %}


0 Likes
Guleria
Shopify Partner
1476 304 421

Please share whole code of cart.liquid

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
0 Likes
Lisa_Dudley
Tourist
26 0 2

Here it is :)

 

<div class="cart page-width{% if cart.items.size == 0%} cart--empty{% endif %}" data-section-id="{{ section.id }}" data-section-type="cart-template" data-cart-token="{{ cart.id }}">


<div class="section-header section-header--small text-center">
<h1 class="section-header__title h2">{{ 'cart.general.title' | t }}</h1>
</div>

{% comment %}
Cart no cookies state
{% endcomment %}
<div class="cart__no-cookies">
<div class="cart-message text-center">
<p>{{ 'cart.general.cookies_required' | t }}</p>
</div>
</div>

{% comment %}
Cart Empty State
{% endcomment %}
<div class="cart__empty">
<div class="cart-message text-center">
<p>{{ 'cart.general.empty' | t }}</p>
<p>{{ 'cart.general.continue_browsing_html' | t: classes: 'btn btn--primary' }}</p>
</div>
</div>

<form action="/cart" method="post" novalidate class="cart__form">
<table class="cart__table">
<thead class="cart__table-header border-bottom">
<th class="text-left" colspan="2">{{ 'cart.label.product' | t }}</th>
<th class="text-center">{{ 'cart.label.price' | t }}</th>
<th class="text-center">{{ 'cart.label.quantity' | t }}</th>
<th class="text-right">{{ 'cart.label.total' | t }}</th>
</thead>

<tbody data-cart-item-list>

{% comment %}
If the cart has no items, then include a item element with a template class
so that it is hidden but still available for use client-side by ajax-cart.js
{% endcomment %}

{%- assign cartItems = 'template ' | split: ' ' -%}
{% if cart.items.size > 0 %}
{%- assign cartItems = cart.items -%}
{% endif %}

{% for item in cartItems %}
<tr class="cart-item{% if item == 'template' %} ajax-cart__template{% endif %}" data-cart-item data-cart-item-id="{{ item.key }}">
<td class="cart-item__image-wrapper">
{% assign itemImage = true %}
{% if item.image == blank and item.product.featured_image == blank %}
{% assign itemImage = false %}
{% endif %}
<a class="cart-item__image-link" href="{{ item.url | within: collections.all }}" style="background-image: {% if itemImage %}url('{{ item | img_url: 'medium' }}'){% else %}none{% endif %};" data-cart-item-background-image data-cart-item-href>
<img class="cart-item__image lazyload {% unless itemImage %}hide{% endunless %}" src="{{ item | img_url: 'medium' }}" alt="{{ item.title | escape }}" data-cart-item-image>
</a>
</td>

<td class="cart-item__meta small--text-left">
<a class="cart-item__meta-title h4" href="{{ item.url }}" data-cart-item-href data-cart-item-title>{{ item.product.title }}</a>
<p class="cart-item__meta-variant" data-cart-item-variant-title>
{% unless item.product.has_only_default_variant %}
{% unless item.variant.title == 'Default Title' %}
{{ item.variant.title }}
{% endunless %}
{% endunless %}
</p>

{% comment %}
Optional, loop through custom product line items if available

Line item properties come in as having two parts. The first part will be passed with the default form,
but p.last is the actual custom property and may be blank. If it is, don't show it.

For more info on line item properties, visit:
- https://help.shopify.com/themes/customization/products/features/get-customization-information-for-pr...

If the item has no properties, then include a property element with a template class
so that it is hidden but still available for use client-side by ajax-cart.js
{% endcomment %}

{%- assign itemProperties = 'template ' | split: ' ' -%}
{%- assign property_size = item.properties | size -%}

{% if property_size > 0 %}
{%- assign itemProperties = item.properties -%}
{% endif %}

<ul class="cart-item__properties" data-cart-item-property-list>
{% for p in itemProperties %}
{% assign first_character_in_key = p.first | truncate: 1, '' %}
{% unless p.last == blank or first_character_in_key == '_' %}
<li class="cart-item__property{% if p == 'template' %} ajax-cart__template{% endif %}{% if p.last == blank %} visually-hidden{% endif %}" data-cart-item-property>
{{ p.first }}:

{% comment %}
Check if there was an uploaded file associated
{% endcomment %}
{% if p.last contains '/uploads/' %}
<a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
{% else %}
{{ p.last }}
{% endif %}
</li>
{% endunless %}
{% endfor %}
</ul>

<p class="cart-item__price-container medium-up--hide">
<span class="cart-item__price" data-cart-item-price>{{ item.price | money }}</span>
<s class="cart-item__original-price" data-cart-item-original-price>{% if item.price != item.original_price %}{{ item.original_price | money }}{% endif %}</s>
</p>

<div class="cart-item__discount-container" data-cart-item-discount-list>
{% comment %}
If the item has no properties, then include a property element with a template class
so that it is hidden but still available for use client-side by ajax-cart.js
{% endcomment %}

{%- assign itemDiscounts = 'template ' | split: ' ' -%}
{% if item.discounts.size > 0 %}
{%- assign itemDiscounts = item.discounts -%}
{% endif %}

{% for discount in itemDiscounts %}
<p class="cart-item__discount text-small{% if discount == 'template' %} ajax-cart__template{% endif %}" data-cart-item-discount>{{ discount.title }}</p>
{% endfor %}
</div>

<p class="small--hide">
<a href="/cart/change?line={{ forloop.index }}&amp;quantity=0" class="btn btn--small btn--clear btn--primary-color cart-item__remove" data-cart-item-delete>{{ 'cart.general.remove' | t }}</a>
</p>

<p class="cart-item__message" data-item-message></p>
</td>

<td class="cart-item__price-wrapper small--hide">
<p>
<span class="cart-item__price" data-cart-item-price>{{ item.price | money }}</span>
<s class="cart-item__original-price" data-cart-item-original-price>{% if item.price != item.original_price %}{{ item.original_price | money }}{% endif %}</s>
</p>
</td>

<td class="cart-item__update-wrapper text-right">

<div class="cart-item__qty">
<label for="quantity_{{ item.key }}" class="cart-item__qty-label" data-cart-item-label-quantity>{{ 'cart.label.quantity' | t }}</label>
<input id="quantity_{{ item.key }}" class="cart-item__qty-input" value="{{ item.quantity }}" type="number" pattern="\d*" min="1" name="updates[{{ item.key }}]" required data-cart-item-input-quantity>
</div>

<a href="/cart/change?line={{ forloop.index }}&amp;quantity=0" class="btn-link cart-item__remove medium-up--hide" data-cart-item-delete>{{ 'cart.general.remove' | t }}</a>
</td>

<td class="text-right small--hide">
<span class="cart-item__price" data-cart-item-line-price>{{ item.line_price | money }}</span>
</td>
</tr>
{% endfor %}
</tbody>
</table>

<footer class="cart-footer">
<div class="grid">
{% if section.settings.cart_notes_enable %}
<div class="grid__item medium-up--one-half cart-note">
<label for="CartSpecialInstructions" class="cart-footer__note-label small--text-center">{{ 'cart.general.note' | t }}</label>
<textarea name="note" id="CartSpecialInstructions" class="cart-footer__note-input" rows="4" data-cart-note>{{ cart.note }}</textarea>
</div>
{% endif %}

<div class="grid__item text-right small--text-center{% if section.settings.cart_notes_enable %} medium-up--one-half{% endif %}">
<p>
<span class="cart__subtotal-title h4">{{ 'cart.general.subtotal' | t }}</span>
<span class="cart-footer__subtotal" data-cart-subtotal>{{ cart.total_price | money }}</span>
</p>

{%- capture taxes_shipping_checkout -%}
{%- if shop.taxes_included and shop.shipping_policy.body != blank -%}
{{ 'cart.general.taxes_included_and_shipping_policy_html' | t: link: shop.shipping_policy.url }}
{%- elsif shop.taxes_included -%}
{{ 'cart.general.taxes_included_but_shipping_at_checkout' | t }}
{%- elsif shop.shipping_policy.body != blank -%}
{{ 'cart.general.taxes_and_shipping_policy_at_checkout_html' | t: link: shop.shipping_policy.url }}
{%- else -%}
{{ 'cart.general.taxes_and_shipping_at_checkout' | t }}
{%- endif -%}
{%- endcapture -%}

<p class="text-small rte">{{ taxes_shipping_checkout }}</p>
<div class="btn-group">
<input type="submit" name="update" class="btn btn--secondary supports-no-js supports-js--hide" value="{{ 'cart.general.update' | t }}">
<button type="submit" name="checkout" class="btn btn--loader" data-cart-submit>
{{ 'cart.general.checkout' | t }}
<span class="btn--loader-balls"></span>
</button>
</div>
<div class="cart-footer__message-container">
<div class="cart-footer__message" data-cart-message></div>
</div>
</div>
</div>
</footer>
</form>
</div>

{% schema %}
{
"name": {
"de": "Warenkorb-Seite",
"en": "Cart page",
"es": "Página de carrito",
"fr": "Page du panier",
"it": "Pagina del carrello",
"ja": "カートページ",
"pt-BR": "Página do carrinho"
},
"settings": [
{
"type": "checkbox",
"id": "cart_notes_enable",
"label": {
"de": "Warenkorb-Notifikationen erlauben",
"en": "Enable cart notes",
"es": "Habilitar notas de carrito",
"fr": "Activer les notes de panier",
"it": "Abilita note carrello",
"ja": "カートメモを有効にする",
"pt-BR": "Ativar observações sobre o carrinho"
},
"default": true
}
]
}
{% endschema %}

0 Likes
Guleria
Shopify Partner
1476 304 421

Change line no. 23 from

<p>{{ 'cart.general.continue_browsing_html' | t: classes: 'btn btn--primary' }}</p>

to

<p><a href="/" class="btn btn--primary">{{ 'cart.general.continue_browsing' | t }}</a></p>

from 

Want to modify or custom changes on store hire me.
Email: guleriathakur43@gmail.com, Skype: navrocks1
If helpful then please Like and Accept Solution.
0 Likes
oadp88
New Member
1 0 0

I would like to redirect the cart button to another page

How can I do that?

 

Here is the  Cart code

 

<div class="container page-cart" data-section-id="{{ section.id }}" data-section-type="cart-template">

{% if cart.item_count > 0 %}
<div class="page-carts">
<h1 class="title-cart">{{ 'cart.general.title' | t }}</h>
</div>

<form action="/cart" method="post" novalidate class="cart">
<table>
<thead class="cart__row cart__header">
<th class="text-left" colspan="2">{{ 'cart.label.product' | t }}</th>
<th>{{ 'cart.label.price' | t }}</th>
<th class="text-left">{{ 'cart.label.quantity' | t }}</th>
<th class="text-left">{{ 'cart.label.total' | t }}</th>
</thead>
<tbody>
{% for item in cart.items %}
<tr class="cart__row border-bottom line{{ forloop.index }} cart-flex{% if forloop.first %} border-top{% endif %}">
<td class="cart__image-wrapper cart-flex-item">
<a href="{{ item.url | within: collections.all }}">
<img class="cart__image" src="{{ item | img_url: '50x50', scale: 2 }}" alt="{{ item.title | escape }}">
</a>
</td>
<td class="cart__meta small--text-left cart-flex-item">
<div class="list-view-item__title">
<a href="{{ item.url }}">
{{ item.product.title }}
{% if item.quantity > 1 %}
<span class="medium-up--hide"><span class="visually-hidden">{{ 'cart.label.quantity' | t }}</span>(x{{ item.quantity }})</span>
{% endif %}
</a>
</div>
{% unless item.variant.title contains 'Default' %}
<div class="cart__meta-text">
{% for option in item.product.options %}
{{ option }}: {{ item.variant.options[forloop.index0] }}<br/>
{% endfor %}
</div>
{% endunless %}

{% comment %}
Optional, loop through custom product line items if available

Line item properties come in as having two parts. The first part will be passed with the default form,
but p.last is the actual custom property and may be blank. If it is, don't show it.

For more info on line item properties, visit:
- http://docs.shopify.com/support/your-store/products/how-do-I-collect-additional-information-on-the-p...
{% endcomment %}
{%- assign property_size = item.properties | size -%}
{% if property_size > 0 %}
<div class="cart__meta-text">
{% for p in item.properties %}
{% unless p.last == blank %}
{{ p.first }}:

{% comment %}
Check if there was an uploaded file associated
{% endcomment %}
{% if p.last contains '/uploads/' %}
<a href="{{ p.last }}">{{ p.last | split: '/' | last }}</a>
{% else %}
{{ p.last }}
{% endif %}
{% endunless %}
{% endfor %}
</div>
{% endif %}


</td>
<td class="cart__price-wrapper cart-flex-item">
{{ item.price | money }}

{% for discount in item.discounts %}
<div class="cart-item__discount medium-up--hide">{{ discount.title }}</div>
{% endfor %}
</td>
<td class="cart__update-wrapper cart-flex-item text-left">

<div class="cart__qty">
<label for="updates_{{ item.key }}" class="cart__qty-label">{{ 'cart.label.quantity' | t }}</label>
<input class="cart__qty-input" type="number" name="updates[]" id="updates_{{ item.key }}" value="{{ item.quantity }}" min="0" pattern="[0-9]*">
</div>
<a href="/cart/change?line={{ forloop.index }}&amp;quantity=0" class="btn btn--small btn--secondary cart__remove medium-up--hide">{{ 'cart.general.remove' | t }}</a>
<input type="submit" name="update" class="btn btn--small cart__update medium-up--hide" value="{{ 'cart.general.update' | t }}">
</td>
<td class="text-left small--hide">
{% if item.original_line_price != item.line_price %}
<div class="cart-item__original-price"><s>{{ item.original_line_price | money }}</s></div>
{% endif %}

<div>
{{ item.line_price | money }}
</div>

{% for discount in item.discounts %}
<div class="cart-item__discount">{{ discount.title }}</div>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>

<footer class="cart__footer">
<div class="row">
{% if section.settings.cart_notes_enable %}
<div class="col-sm-6 col-12 medium-up--one-half cart-note">
<div class="cart_border">
<label for="CartSpecialInstructions" class="cart-note__label small--text-center"><span>Note</span>{{ 'cart.general.note' | t }}</label>
<textarea rows="6" name="note" id="CartSpecialInstructions" class="cart-note__input">{{ cart.note }}</textarea>
</div>
</div>
{% endif %}
<div class="col-sm-6 col-12 text-right small--text-center{% if section.settings.cart_notes_enable %} medium-up--one-half{% endif %}">
<div class="cart_border">
<div>
<span class="cart__subtotal-title"><span id="bk-cart-subtotal-label">{{ 'cart.general.subtotal' | t }}</span></span>
<span class="cart__subtotal"><span id="bk-cart-subtotal-price">{{ cart.total_price | money }}</span></span>
</div>
{% if cart.total_discounts > 0 %}
<div class="cart__savings">
{{ 'cart.general.savings' | t }}
<span class="cart__savings-amount">{{ cart.total_discounts | money }}</span>
</div>
{% endif %}
<div class="cart__shipping">{{ 'cart.general.shipping_at_checkout' | t }}</div>
<a href="collections/all" class="btn btn--secondary cart__update cart__continue--large small--hide" >{{ 'cart.general.continue_shopping' | t }}</a>
<input type="submit" name="update" class="btn btn--secondary cart__update cart__update--large small--hide" value="{{ 'cart.general.update' | t }}">
<input type="submit" name="checkout" class="btn btn--small-wide" value="{{ 'cart.general.checkout' | t }}">
{% if additional_checkout_buttons %}
<div class="additional-checkout-buttons">{{ content_for_additional_checkout_buttons }}</div>
{% endif %}
</div>
</div>
</div>
</footer>
</form>
{% else %}
<div class="empty-page-content text-center">
<span class="ico_empty"><i class="material-icons">shopping_basket</i></span>
<p class="cart_empty">{{ 'cart.general.empty' | t }}</p>
<div class="cookie-message">
<p>{{ 'cart.general.cookies_required' | t }}</p>
</div>
<a href="/" class="btn btn--has-icon-after cart__continue-btn sn"><i class="fa fa-long-arrow-left" aria-hidden="true"></i>{{ 'general.404.link' | t }}</a>
</div>
{% endif %}
</div>

{% schema %}
{
"name": "Cart page",
"settings": [
{
"type": "checkbox",
"id": "cart_notes_enable",
"label": "Enable cart notes",
"default": false
}
]
}
{% endschema %}

0 Likes