Author Topic: [Bakery] Link to cart contents  (Read 3845 times)

Offline svsanchez

  • Posts: 486
[Bakery] Link to cart contents
« on: November 19, 2012, 09:40:31 PM »
Hello Community

I would like to add a "MY SHOPPING CART" link and would like to know which URL I should use. I have the shopping cart buttons appearing in my bakery but I need to add a link to the shopping cart contents on each page of the site I am building, even if it's not part of the bakery. When I click the shopping cart buttons which appear on the bakery pages I get the same URL so this doesn't work for me.

Thank you!

Offline Ruud

  • Posts: 3658
  • Gender: Male
  • Do not use PM for help! Please use the forum!
    • Dev4Me - Professional WebsiteBaker Development
Re: [Bakery] Link to cart contents
« Reply #1 on: November 19, 2012, 10:14:09 PM »
The bakery checkout is a virtual state any bakery page can have. So there is no real "checkout page".
What you can do is identify (one of your) bakery page(s) and create a link with the parameter ?view_cart=true

I.e.: www-yoursite-com/pages/bakery.php?view_cart=true

You could also use the minicart funtion built in Bakery:
http://www.bakery-shop.ch/#minicart

Offline svsanchez

  • Posts: 486
Re: [Bakery] Link to cart contents
« Reply #2 on: November 20, 2012, 05:33:17 AM »
Hello Ruud, as always thank you for your kind assistance. I will give that droplet a try!

jacobi22

  • Guest
Re: [Bakery] Link to cart contents
« Reply #3 on: November 20, 2012, 12:33:26 PM »
i use a image button with a hardcoded direct link to the shop-url (see the link in the bakery settings)

the hardcoded part, somewhere in the top of the template-index.php (change the url with your shopping-url)

Code: [Select]
<?php
define
('BASKET''http://cms/CMS_WB/wb_reform/pages/artikeluebersicht.php');
   
?>

and the image-button, where ever you want in your template

Code: [Select]
<div id="basket"><a href='<?php echo BASKET?>?view_cart=yes'><img src='<?php echo TEMPLATE_DIR?>/img/warenkorb.gif' alt='Warenkorb' title='Warenkorb' style='border:0px'  /><br />Zum Warenkorb</a></div>

Offline rumen

  • Posts: 408
Re: [Bakery] Link to cart contents
« Reply #4 on: May 30, 2016, 12:58:59 PM »
Nice and elegant workaround, but what we do with the second language in 2 languages site? When I point to http://......./pages/sample.php - this is for one language - if customer comes from the second language and click on that link will go to the other (the first one). Otherwise - yes it works!

Offline Gast

  • Posts: 5920
Re: [Bakery] Link to cart contents
« Reply #5 on: May 30, 2016, 01:20:21 PM »
only a idea...
with different languages, you can use the LANGUAGE-constant in a simple PHP-Question like
Code: [Select]
<?php
if (LANGUAGE == 'EN')
    {
define('BASKET''your_link_to_the_english_overview_page');}
elseif [
LANGUAGE =='ES')
    {
define('BASKET''your_link_to_the_spanish_overview_page');}
else {
define('BASKET''your_link_to_the_default_overview_page_in_your_systemlanguage');}

also possible to write this in a different format

Offline rumen

  • Posts: 408
Re: [Bakery] Link to cart contents
« Reply #6 on: May 30, 2016, 01:32:13 PM »
I put the code with the links, but I got completely white screen. Maybe I did any mistake. http://apokalypsabg.org/

Offline Gast

  • Posts: 5920
Re: [Bakery] Link to cart contents
« Reply #7 on: May 30, 2016, 01:39:50 PM »
sorry for that, a little typofix - using [ instead of ( in line 4 -> elseif (LANGUAGE =='ES')

Code: [Select]
<?php
if (LANGUAGE == 'EN')
    {
define('BASKET''your_link_to_the_english_overview_page');}
elseif (
LANGUAGE =='ES')
    {
define('BASKET''your_link_to_the_spanish_overview_page');}
else {
define('BASKET''your_link_to_the_default_overview_page_in_your_systemlanguage');}

Offline rumen

  • Posts: 408
Re: [Bakery] Link to cart contents
« Reply #8 on: May 30, 2016, 01:41:54 PM »
I put on the same place where was the old code which worked for 1 language:

Code: [Select]
<?php
if (LANGUAGE == 'BG')
    {
define('BASKET''http://apokalypsabg.org/pages/knigi.php');}
elseif [
LANGUAGE =='EN')
    {
define('BASKET''http://apokalypsabg.org/pages/books.php');} 
else {
define('BASKET''http://apokalypsabg.org/pages/knigi.php');}
?>

But the result is white screen.

Offline Gast

  • Posts: 5920
Re: [Bakery] Link to cart contents
« Reply #9 on: May 30, 2016, 01:51:49 PM »
I put on the same place where was the old code which worked for 1 language:

Code: [Select]
<?php
if (LANGUAGE == 'BG')
    {
define('BASKET''http://apokalypsabg.org/pages/knigi.php');}
elseif [
LANGUAGE =='EN')
    {
define('BASKET''http://apokalypsabg.org/pages/books.php');} 
else {
define('BASKET''http://apokalypsabg.org/pages/knigi.php');}
?>

look here (red marked)

Quote
elseif [LANGUAGE =='EN')

must be an (


Offline rumen

  • Posts: 408
Re: [Bakery] Link to cart contents
« Reply #10 on: May 30, 2016, 02:16:06 PM »
Works like a charm now :)

 

postern-length