Monthly Archives: March 2011

TheCartPress translation into Spanish

The community drives TheCartPress translations into Spanish

  • Thanks to Inzubi for translating into spanish.

The community has already translated TheCartPress eCommerce plugin into Spanish, There are translation files in the directory TheCartPress>Languages.

In the community we have created a working group for translations.

Feel free to create other translations!

TheCartPress e-Commerce 1.0.7 is available

Launched TheCartPress 1.0.7, e-Commece cart plugin for WordPress:

  • Improvements in Buy Button (less code)
  • CVC field, Card type and Cardholder in CC Offline (Thanks to the community)
  • Order editor: button to delete card data (Thanks to the community)
  • Plugin Auto-Checking
  • New Settings: Default Country, Decimal point and thousands separator (Thanks to the community)
  • New templates functions: tcp_number_format and tcp_input_number
  • Checkout improvements (hooks, other costs, validation) (Thanks to the community)
  • Added more useful hooks for plugin development
  • New field in Payment and Shipping methods: Active/Not active
  • TheCartPress Payment and Shipping methods editor: new column to see active/inactive methods
  • Send separate emails to customer and to merchant and when the paid has been done (Thanks to the community)
  • $thecartpress object available for plugin development
  • Checkout page is now child of Shopping cart page
  • Folder for localisation

This is, certainly, the largest software update so far.

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.


Basic Demo

We have published a first demo version of a basic store where you can see lists of products at home page (with shortcodes) and the flexibility of TheCartPress to adapt easily to the WordPress themes. Soon we show more e-Commerce features in the demo (Related products and posts in any ways, Multilingual support, etc.)

Enjoy it!
Best regards

Spam Attack

The last Friday we had a little spam attack. For this reason we decided to delete all inactive user accounts.
Sorry if a user has been deleted by mistake, if so, please, re-register in the community.

Regards