WebsiteBaker Community Forum

WebsiteBaker Support (2.8.x) => Bakery Shop => Topic started by: svsanchez on November 19, 2012, 09:40:31 PM

Title: [Bakery] Link to cart contents
Post by: svsanchez 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!
Title: Re: [Bakery] Link to cart contents
Post by: Ruud 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
Title: Re: [Bakery] Link to cart contents
Post by: svsanchez 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!
Title: Re: [Bakery] Link to cart contents
Post by: jacobi22 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>
Title: Re: [Bakery] Link to cart contents
Post by: rumen 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!
Title: Re: [Bakery] Link to cart contents
Post by: Gast 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
Title: Re: [Bakery] Link to cart contents
Post by: rumen 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/
Title: Re: [Bakery] Link to cart contents
Post by: Gast 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');}
Title: Re: [Bakery] Link to cart contents
Post by: rumen 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.
Title: Re: [Bakery] Link to cart contents
Post by: Gast 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 (

Title: Re: [Bakery] Link to cart contents
Post by: rumen on May 30, 2016, 02:16:06 PM
Works like a charm now :)