Hi
After some good practice with the base features of Couch, I started with a Shopping Cart Project.
Thanks to the good tutorial I've configured a lot of steps without a problem, but know I'm stuck at the point of adding items to the cart.
In this case, the cart is on the same page as the productpage. (gerechten.php)
So I have to change to following setting from cart.php to gerechten.php, am I right?
I followed the instructions of working with pp_product_form and pp_cart_items, and I added some basic variables like the title and image in there.
The cart is implemented in the sidebar, but after clicking at "Add to cart", nothing happens.
In the page source there isn't any content loaded in the sidebar.
Am I missing some steps here?
Thanks for looking into it!
Here is the full code off my productpage/cartpage "gerechten.php".
After some good practice with the base features of Couch, I started with a Shopping Cart Project.
Thanks to the good tutorial I've configured a lot of steps without a problem, but know I'm stuck at the point of adding items to the cart.
In this case, the cart is on the same page as the productpage. (gerechten.php)
So I have to change to following setting from cart.php to gerechten.php, am I right?
- Code: Select all
$pp['tpl_cart'] = 'gerechten.php';
$pp['tpl_products'] = 'gerechten.php';
I followed the instructions of working with pp_product_form and pp_cart_items, and I added some basic variables like the title and image in there.
The cart is implemented in the sidebar, but after clicking at "Add to cart", nothing happens.
In the page source there isn't any content loaded in the sidebar.
Am I missing some steps here?
Thanks for looking into it!
Here is the full code off my productpage/cartpage "gerechten.php".
- Code: Select all
<?php require_once ('dashboard/cms.php'); ?>
<cms:embed 'lang_getter.html' />
<cms:template title="Gerechten" order="10" clonable="1" dynamic_folders="1">
<cms:editable name="productimg" label="Afbeelding (200x200)" type="image" order="1" width="200" width="200" crop="1" />
<cms:editable name="pp_price" label="Prijs (per 100gr.)" desc="Geen euroteken toevoegen" type="text" order="2" />
<cms:editable name="nederlands" label="Nederlands" type="group" order="10"/>
<cms:editable name="page_title_nl" group="nederlands" label="Naam gerecht (NL)" type='text' order="10"/>
<cms:editable name="page_content_nl" group="nederlands" label="Beschrijving gerecht (NL)" type="richtext" order="10" />
<cms:editable name="engels" group="engels" label="Engels" type="group" order="20"/>
<cms:editable name="page_title_en" group="engels" label="Naam gerecht (EN)" type='text' order="20"/>
<cms:editable name="page_content_en" group="engels" label="Beschrijving gerecht (EN)" type="richtext" order="20"/>
<cms:editable name="frans" group="frans" label="Frans" type="group" order="30"/>
<cms:editable name="page_title_fr" group="frans" label="Naam gerecht (FR)" type='text' order="30"/>
<cms:editable name="page_content_fr" group="frans" label="Beschrijving gerecht (FR)" type="richtext" order="30" />
<cms:editable name="indonesie" group="indonesie" label="Bahasa Indonesia" type="group" order="40"/>
<cms:editable name="page_title_in" group="indonesie" label="Naam gerecht (BA)" type='text' order="40"/>
<cms:editable name="page_content_in" group="indonesie" label="Beschrijving gerecht (BA)" type="richtext" order="40"/>
</cms:template>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Achtergrond - Casa Di Batavia</title>
<meta name="description" content="Naast de schitterende natuurlandschappen, de prachtige kustlijnen en de indrukwekkende cultuur staat
Indonesië bekend om haar heerlijke keuken. Dit komt voornamelijk door de zeer uiteenlopende specerijen die beschikbaar zijn in het land. Vandaag
brengt Casa di Batavia deze keuken voor u tot in Gent.">
<cms:embed 'styles.html'/>
</head>
<body>
<div id="wrapper" class="container">
<header>
<cms:embed 'header.html'/>
</header>
<div class="row">
<div id="content" class="col-md-9">
<cms:pages order='asc'>
<div class="row product-item">
<div class="col-md-3 col-xs-3 product-img">
<img src="<cms:show productimg />">
</div>
<div class="col-md-6 col-xs-6">
<h2>
<cms:if my_lang='nl'><cms:show page_title_nl /></cms:if>
<cms:if my_lang='en'><cms:show page_title_en /></cms:if>
<cms:if my_lang='fr'><cms:show page_title_fr /></cms:if>
<cms:if my_lang='in'><cms:show page_title_in /></cms:if>
</h2>
<p>
<cms:if my_lang='nl'><cms:show page_content_nl /></cms:if>
<cms:if my_lang='en'><cms:show page_content_en /></cms:if>
<cms:if my_lang='fr'><cms:show page_content_fr /></cms:if>
<cms:if my_lang='in'><cms:show page_content_in /></cms:if>
</p>
</div>
<div class="col-md-3 col-xs-3">
<h3>
€ <cms:show pp_price />
</h3>
<cms:pp_product_form class="cart-form">
<input class="product-quantity" name="qty" id="quantity" type="number" step="50" value="100" title="Quantity">
<input class="button product-add" type="submit" value="Add to Cart">
</cms:pp_product_form>
<h4>
<cms:folders>
<cms:show k_folder_title /> <br>
</cms:folders>
</h4>
</div>
</div>
</cms:pages>
</div>
<aside id="sidebar" class="col-md-3">
<cms:pp_cart_items>
<cms:show page_title_nl />
<img src="<cms:show productimg />">
<cms:if my_lang='nl'><cms:show page_content_nl /></cms:if>
</cms:pp_cart_items>
<cms:embed 'sidebar.html' />
</aside>
</div>
</div>
<footer class="container-fluid">
<cms:embed 'footer.html' />
</footer>
<cms:embed 'scripts.html' />
</body>
</html>
<?php COUCH::invoke(); ?>