WebsiteBaker Logo
  • *
  • Templates
  • Help
  • Add-ons
  • Download
  • Home
*
Welcome, Guest. Please login or register.

Login with username, password and session length
 

News


WebsiteBaker 2.13.8 is now available!


R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WB
https://forum.websitebaker.org/index.php/topic,32355.0.html


* Support WebsiteBaker

Your donations will help to:

  • Pay for our dedicated server
  • Pay for domain registration
  • and much more!

You can donate by clicking on the button below.


  • Home
  • Help
  • Search
  • Login
  • Register

  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • [Bakery] Link to cart contents
  • Print
Pages: [1]   Go Down

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

Offline svsanchez

  • Posts: 589
[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!
Logged

Offline Ruud

  • Posts: 3671
  • 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
Logged
Dev4me - WebsiteBaker modules - WBhelp.org

Offline svsanchez

  • Posts: 589
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!
Logged

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>
Logged

Offline rumen

  • Posts: 480
  • Gender: Male
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!
Logged

Offline jacobi22

  • Betatester
  • **
  • Posts: 5921
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
Logged

Offline rumen

  • Posts: 480
  • Gender: Male
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/
Logged

Offline jacobi22

  • Betatester
  • **
  • Posts: 5921
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');}
Logged

Offline rumen

  • Posts: 480
  • Gender: Male
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.
Logged

Offline jacobi22

  • Betatester
  • **
  • Posts: 5921
Re: [Bakery] Link to cart contents
« Reply #9 on: May 30, 2016, 01:51:49 PM »
Quote from: 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');}
?>

look here (red marked)

Quote
elseif [LANGUAGE =='EN')

must be an (

Logged

Offline rumen

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

  • Print
Pages: [1]   Go Up
  • WebsiteBaker Community Forum »
  • WebsiteBaker Support (2.8.x) »
  • Bakery Shop »
  • [Bakery] Link to cart contents
 

  • SMF 2.0.19 | SMF © 2017, Simple Machines
  • XHTML
  • RSS
  • WAP2