How to

Updating plugins for TheCartPress

Today, we have updated a few plugins for TheCartPress. Please, see details:

Launched the TheCartPress – Product Options 1.0.4.

  • Compatible with TheCartPress 1.1.1
  • Product Atributes: Added Custom fields for Product options

Launched the TheCartPress – CSV Loader 1.0.5

  • Compatible with TheCartPress 1.1.1
  • Product Atributes: TheCartPress custom fields support
  • Extend products categorization: Allow to add and manage taxonomies (categories, tags and custom taxonomies)

Launched the TheCartPress – Discount 1.0.1

  • Compatible with TheCartPress 1.1.1
  • Comercial rules: Cart discounts
  • Comercial rules: Product discounts

Enjoy them!

Showing product images

It is important to start thinking and planning what image sizes you’ll need for the entire store and blog. Then set up the Thumbnail size, Medium size and Large size in the backend (settings>media). And add the extra size you need in the function file.

Be sure your theme has thumbnails support
In your function must be:

/ / This theme uses thumbnails post
add_theme_support (post-thumbnails');

To add extra image sizes in a theme that support thumbnails you must add it in your function.php

  • Using 3 extra sizes in function.php:
/*Add extra image size to list products in sidebar
add_image_size( 'mini-thumbnail', 45, 45 );// mini thumbnails
/*Add extra image size to list products in main 
add_image_size( 'medium-thumbnail', 85, 85 ); // mini medium 
/*Add extra image size to show in single products 
add_image_size( 'single-product', 260, 9999 ); // single product 

With TheCartPress you can work exactly the same way you do with posts by WordPress.

Basically you can add as many images as you need. The images you upload from the editor of a product will remain assigned to that product. You can mark one image as featured image.

To display the images you can choose to insert them into the content individually or in galleries or both ways. You can do so from the publisher of the product as from your templates, with template tags of WordPress.

The best thing for me is to use template tags for featured images and also for the gallery. Since TheCartPress 1.0.8 you can insert the featured image  into content using  “TheCartPress theme compatibility” (See below). This saves time as there is no need to insert the images and gallery in content when editing the product. Only upload images and make featured image. Indispensable to an end customer/merchant?

I like themes that make the job as much as possible. Working with template tags the general design is more homogeneous and roboust but less flexible.

There is much information about it on the internet.

Showing thumbnail images in your theme

  • In standard WordPress loops:

Product Thumbnail Linking to the Product Permalink

 <?php if ( has_post_thumbnail()) : ?>
   <a href="<?php the_permalink(); ?" title="<?php the_title_attribute(); ?>" >
   <?php the_post_thumbnail(); ?>
   </a>
 <?php endif; ?>

Product Medium Thumbnail Linking to the Product Permalink

 <?php if ( has_post_thumbnail()) : ?>
   <a href="<?php the_permalink(); ?" title="<?php the_title_attribute(); ?>" >
   <?php the_post_thumbnail('medium-thumbnail'); ?>
   </a>
 <?php endif; ?>
  • In configurable TCP loops:

Product Thumbnail Linking to the Product Permalink.

 
<?php if ( $see_image ) : ?>
<div class="entry-post-thumbnail">
<a class="size-thumbnail" href="<?php the_permalink(); ?>"><?php the_post_thumbnail($image_size); ?></a>
</div><!-- .entry-post-thumbnail -->
<?php endif; ?>	

Showing single product images in your theme

When working with configurable TCP-loops, you can set from the backend (Appearance> Tcp-loops) the settings of the TCP-loop you call from your theme.
At this point you can only have one setting for all the Tcp loops you’re using called directly from your templates.
Through widgets and shortcodes you can have as many configurations as you’re using.

Therefore we recommend for the moment that you use in your single product page a non Tcp configurable loop if your needs are different in, typical case is different image sizes needs for thumbnails and single images of products.

In future versions you can set the TCP loop in combination with WordPress conditional tags (is-home, is_category, is_single, is_author, etc).

You have 3 options 4 options to display the featured image in single product page:

  1. Use TheCartPress theme compatibility. With this method you do not need to insert the image into the content of each product. It automatically displays the featured picture:
    TheCartPress>Settings> Theme compatibility settings: 
    • “See image in content” checked
    • Chosse “Image size in content”, “Image align in content”, “Image align in content”
  2. Insert the image(s) into the content of each product. (button images > upload > insert in post)
  3. Create a template tag directly in your template, With this method you do not need to insert the image into the content of each product. It automatically displays the featured picture.
  4. <?php if ( has_post_thumbnail()) : ?>
       <?php the_post_thumbnail('single-product'); ?>
    <?php endif; ?>
    
  5. Create a gallery in product content or using template tag for gallery in your theme.
    Shortcode Gallery in content editor or template tag in template file

    / / Template tag in template file
    echo do_shortcode('gallery-shortcode');
    

The products images you see in demo, are displayed with template tag in TCP Loop. Use TCP Loops

List products in your home page in grid format

A typical question is how to make a list/grid of products visible on the homepage.
Eg. Products of a certain category, a particular supplier products, products with a particular tag, best sellers, latest products viewed, etc.

TheCartPress is closely integrated with WordPress and you have as much chance as wordpress offers.
My favorite is to use the TCP Custom Post Type widget included in TheCartPress in a custom homepage with widgetized areas. The TCP Custom Post Type widget  allows you to create lists of products, posts, and any other post type you have. Used in combination with the TCP Loops becomes a super powerful tool.

But this article focuses on the easiest way that not require to edit your templates.

It’s about creating a page with many shortcodes as you need and set it as home page in WordPress. You can see a basic example in demo.thecartpress.com

Requeriments

Now you can use the internal loop called “default”, but you can also use your custom loops from your theme. The template loops name in your theme must begin with “loop-” eg: “loop-products-grid.php”

Instructions

  • Create a shortcode in the shortcode generator with the products you want to display (TheCartPress > shortcodes). Make sure you select a configurable loop in the settings.  eg: “default”
  • Create a page. In its content type the  shortcode previosly created. You can use as many shortcodes as you need.
  • In the WordPress Settings->Reading, change the first setting called ‘Front page displays’. Set it to ‘A static page (select below) ‘ and select in the Front Page combo your new page.

The Shortcode Generator in action

Tcp Loop in shortcode generator

Tcp Loop in shortcode generator

Did not work?

Be sure your theme has thumbnails support.
In your function:

/ / This theme uses thumbnails post
add_theme_support (‘post-thumbnails’);

Make sure you have integrated the loop-tcp-grid.php in your theme:
Use TCP loops
Make sure you have TheCartPress + 1.1.0

Make sure you are calling the loop-tcp-grid.php from your shortcode:
Shortcode>Loop:loop-tcp-grid.php
Make sure you are calling the default from your shortcode:
Shortcode>Loop:default

Make sure that your Shortcode shows the image:
Shortcode>Advanced options>See image option: “checked”.
And choose the image size in combo.

When editing the product make sure there is a featured picture on each product.


Multilingual support for WordPresss Stores with WPML and TheCartPress

Complete Multilingual support for WordPresss Stores.

With WordPress Multilingual WPML plugin and TheCartPress eCommerce plugin you can develop multilingual Stores. Allowing translate products, ecommerce taxonomies (categories, tags and suppliers), menus and even the theme’s texts.

The Cart Press eCommerce plugin is natively integrated with WordPress, uses WordPress API running perfect with WPML.