Page Templates

We realise that sometimes short codes just won’t do and one needs the flexibility to create page templates. Fortunately, this is rather easy with DukaPress. πŸ™‚

Use this to make the Checkout Page

<?php echo (do_shortcode('[dpsc_checkout]')); ?>

Use this to make the Thank You Page

<?php echo (do_shortcode('[dpsc_thank_you_page]')); ?>

Use either of these to display the product in a single page/post

<?php echo (do_shortcode('[dpsc_display_product]')); ?> //shows "Add to Cart" button
<?php echo (do_shortcode('[dpsc_display_product direct="true"]')); ?>//shows "Buy Now" button

Use this shortcode to generate an order log

<?php echo (do_shortcode('[dp_order_log]')); ?>

Use this to display products in a Grid layout

<?php echo (do_shortcode('[dpsc_grid_display]')); ?>

This particular piece of code has three variables that you need to define:

  1. category – should contain the products category id – you can have more than one id separated by commas.
  2. total – defines the number of products should be displayed.
  3. column – is the number of columns in which you want to display products
  4. per_page – this is the number of products to display per page
  5. order – defines how the products will be ordered. Possible values are ASC, DESC or rand. You can only use one at time.

For example:
This will display products from category ID 1, in three columns accross the page. It will display a total of 12 products, with 4 on each page. The products will be ordered in a descending way:

<?php 
echo (do_shortcode('[dpsc_grid_display category=”1” total="12" column="3" per_page="4" type="duka" order="DESC"]')); 
?>

Use this to make a custom search results template

<?php echo (do_shortcode('[dp_search]')); ?>

This bit of code needs to be placed inside the page in which you intend to display your search results – using the DukaPress Search widget. It takes two parameters:

  1. column – is the number of columns in which you want to display products
  2. per_page – this is the number of products to display per page

When in use, the search shortcode should look something like:

<?php echo (do_shortcode('[dp_search per_page="12" column="3"]')); ?>

This will show 12 results per page arranged in three columns.

The Shopping Cart
As you may know, DukaPress has got widgets to display the shopping cart on sidebars and other widget areas. What if you want to embed these onto a page template? Simple:

Mini Shopping Cart:

<?php echo dpsc_print_cart_html(TRUE); ?>

Detailed Shopping Cart:

<?php echo dpsc_print_cart_html(); ?>

The above should be inside DIV tags with class=”dpsc-shopping-cart”

© 2016 DukaPress. All rights reserved.
Design By Madoido.