Jump to content

[Customize] - Add dropdown to default cart


Recommended Posts

As you know, from Prestashop 1.7, your mini cart not support dropdown cart. Prestashop 1.7 remove some features functions which I think really need for your store. In this article, we will show you how to add dropdown cart with hover. Please follow some step above


Step 1: Connect to your FTP account and go to themes/yourthemes/module/ps_shoppingcart/ps_shoppingcart.tpl and add this code



<div class="body cart-hover-content">
<ul>
{foreach from=$cart.products item=product}
<li class="cart-wishlist-item">
{include 'module:ps_shoppingcart/ps_shoppingcart-product-line.tpl' product=$product}
</li>
{/foreach}
</ul>
<div class="cart-subtotals">
{foreach from=$cart.subtotals item="subtotal"}
<div class="{$subtotal.type}">
<span class="label">{$subtotal.label}</span>
<span class="value">{$subtotal.value}</span>
</div>
{/foreach}
</div>
<div class="cart-total">
<span class="label">{$cart.totals.total.label}</span>
<span class="value">{$cart.totals.total.value}</span>
</div>
<div class="cart-wishlist-action">
<a class="cart-wishlist-viewcart" href="{$cart_url}">view cart</a>
<a class="cart-wishlist-checkout" href="{$urls.pages.order}">{l s='Check Out' d='Shop.Theme.Actions'}</a>
</div>
</div>

You need put this code inside div “blockcart cart-preview” which below #desktop_cart


IMG_26052017_160209_0.png


Continue, you need go to ps_shoppingcart-product-line.tpl in the same director and add this code



{if $product.images}
<div class="shoppingcart_img">
<img src="{$product.images.0.bySize.small_default.url}" title="{$product.name}"/>
</div>
{/if}

IMG_26052017_160215_0-645x400.png


 


Okay, so now you cart is showing, now you need use CSS to modify it and make it look nice. You can see from our demo HERE


 


The article from: https://prestagold.com/how-to-add-dropdown-mini-cart-to-prestashop-1-7/


Link to comment
Share on other sites

  • 1 month later...
  • 10 months later...
  • 4 months later...

We have made an Ajax Drop Down module that works great on Prestashop 1.7 and can also display a long list of products with the "Checkout" button always visible.

You can have a look here:

https://prestabuilder.com/ajax-drop-down-cart-module/

 

You can purchase the module for 19 EUR here:

https://prestabuilder.com/prestashop-17-modules

Edited by Andrej Stas (see edit history)
Link to comment
Share on other sites

  • 1 year later...

I have some JS problem with your template

VM94:1 Uncaught SyntaxError: Unexpected token � in JSON at position 0
    at JSON.parse (<anonymous>)
    at Function.m.parseJSON (bottom-78eccd325.js:39)
    at HTMLDocument.<anonymous> (bottom-78eccd325.js:995)
    at HTMLDocument.dispatch (bottom-78eccd325.js:39)
    at HTMLDocument.g.handle (bottom-78eccd325.js:39)
    at Object.trigger (bottom-78eccd325.js:39)
    at S (bottom-78eccd325.js:39)
    at XMLHttpRequest.<anonymous> (bottom-78eccd325.js:39)

 

and 

 

1 Unchecked runtime.lastError: The message port closed before a response was received.

 

Please let me know how can I fix it.

js.jpg

Link to comment
Share on other sites

  • 4 months later...
On 10/25/2018 at 7:03 PM, Andrej Stas said:

We have made an Ajax Drop Down module that works great on Prestashop 1.7 and can also display a long list of products with the "Checkout" button always visible.

You can have a look here:

https://prestabuilder.com/ajax-drop-down-cart-module/

 

You can purchase the module for 19 EUR here:

https://prestabuilder.com/prestashop-17-modules

does obviously not work with version 1.7.5.6 and probably higher. I have tried it by using your editor but the cart doesn´t drop down.
Any solution?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...