Extensions, OpenCart

Display Weight and Size in product details

Display weight and size in product details

Display weight and size in product details

If you want to display the weight and size (lenght/width/height) on the product details page just upload the following file to your vqmod/xml folder:

Product dimensions

This is the code:

<modification>

 <id>Product Dimensions</id>
 <version>1.0.0</version>
 <vqmver>2.1.2</vqmver>
 <author>everthemes.com</author>

 <file name="catalog/controller/product/product.php">

  <operation>
   <search position="after"><![CDATA[
    $this->data['text_model'] = $this->language->get('text_model');
   ]]></search>
   <add><![CDATA[
    $this->data['text_weight'] = $this->language->get('text_weight');
    $this->data['text_size'] = $this->language->get('text_size');
   ]]></add>
  </operation>

  <operation>
   <search position="after"><![CDATA[
    $this->data['model'] = $product_info['model'];
   ]]></search>
   <add><![CDATA[
    $this->data['weight'] = number_format($product_info['weight'],2) . ' kg';
    $this->data['length'] = number_format($product_info['length'],2) .  ' cm';
    $this->data['width'] = number_format($product_info['width'],2) .  ' cm';
    $this->data['height'] = number_format($product_info['height'],2) .  ' cm';
   ]]></add>
  </operation>

 </file>

 <file name="catalog/view/theme/*/template/product/product.tpl">
  <operation>
   <search position="after"><![CDATA[
    <span><?php echo $text_stock; ?></span> <?php echo $stock; ?>
   ]]></search>
   <add><![CDATA[
    <?php if ($weight) { ?>
    <br /><span><?php echo $text_weight; ?></span> <?php echo $weight; ?>
    <?php } ?>
    <?php if ($length || $width || $height) { ?>
    <br /><span><?php echo $text_size; ?></span> <?php echo $length; ?> x <?php echo $width; ?> x <?php echo $height; ?>
    <?php } ?>
   ]]></add>
  </operation>
 </file>

 <file name="catalog/language/english/product/product.php">
  <operation>
   <search position="before"><![CDATA[
    ?>
   ]]></search>
   <add><![CDATA[
    $_['text_weight']               = 'Weight:';
    $_['text_size']               = 'Size (LxWxH):';
   ]]></add>
  </operation>
 </file>

</modification>

Change the units from line 25 to 28.

Blog, Releases

Sellegance for OpenCart 1.4.0

Sellegance theme for OpenCart 1.4.0

Sellegance theme for OpenCart 1.4.0

New Sellegance for OpenCart 1.4.0

A new release with important changes:

  • Added option to enable/disable responsive layout
  • Added Nivo Slider
  • Added previous/next product (vQmod)
  • Added custom body classes for advanced customization (vQmod)
  • Added Facebook Like Button
  • Supports responsive videos
  • Moved Hide Wishlist and Comparison to vqmod
  • Moved Product Image Zoom to vqmod with performance improvements for thumbnails
  • Fixed missing language variable in guest checkout
  • Fixed Subcategory Thumbnails for compatiblity with other modules (vQmod)
  • Added more custom color options in the theme module
  • Minor CSS fixes
  • Updated documentation

How to update?

Remember that you need Vqmod installed.
  1. Reupload the files and make sure to save your settings in the Sellegance Theme Options module.
  2. Edit your Image Settings in System > Settings > your store > Image tab. Change Additional Product Image Size to 62×62.
    Additional Product Image Size
  3. If you are using the function to hide the wishlist and comparison links upload the files sellegance_remove_comparison.xml and sellegance_remove_wishlist.xml from the Additional Extensions folder to vqmod/xml on your server.
  4. Clear your vqmod cache.

Let me know your thoughts 🙂

If you have any issues contact me through my profile page on Themeforest.

OpenCart

Replace the “sale” bubble with your own image in Sellegance theme

It’s easy to change the “SALE” text in the bubble in Sellegance theme with your own image.

Paste the following in catalog/view/theme/sellegance/stylesheet/custom.css

.onsale {

  background: transparent url('../images/new_on_sale.png') no-repeat;

  -webkit-box-shadow: none;
  -moz-box-shadow: none;
  box-shadow: none;

  padding:0;

  /* change height/width according to your image */
  height: 35px;
  width: 35px;

  /* hide the SALE text. */
  text-indent: -9999px;

}

If you only want to add a background image and keep the text remove text-indent: -9999px;

The full path of the example image is catalog/view/theme/sellegance/images/new_on_sale.png. Of course, you need to change the height and width values to match your image dimensions.

OpenCart

Display 4 products per row when using sidebar, Fortuna theme

Fortuna theme has the option to easily hide the sidebar to display 4 products on each row on category page. But it’s easy to display 4 products even if you have a sidebar enabled.

Just paste the following code in custom.css (if you are using a custom stylesheet) or in Custom CSS Code field in Fortuna Theme Options module.

#maincontent.span9 .grid-box {
  max-width: 25%; 
  min-width: 25%; 
  *width: 25%;
}
#maincontent.span9 .alpha4 {
  clear: left;
  margin-left: 0;
}
#maincontent.span9 .alpha3 {
  clear: none;
}
.span9 .grid-box .inner {
  border-left-color: #eee;
}
.grid-box.alpha .inner,
.span9 .alpha4 .inner, 
.span12 .alpha4 .inner {
  border-color:#fff;
}
.grid-box:hover .inner {
  border-color: #bbb;
}
OpenCart

Add a product to cart and redirect to checkout page.

To redirect to checkout open catalog/view/theme/[your-theme]/js/custom.js and catalog/view/theme/[your-theme]/template/product/product.tpl

In both files find the following code:


if (json['success']) {
  $('#notification').html('<div class="alert success">' + json['success'] + '<a class="close" data-dismiss="alert" href="#">&times;</a></div>');
  $('.alert success').fadeIn('slow');
  $('#cart-total').html(json['total']);
  $('html, body').animate({ scrollTop: 0 }, 'slow');
}

And replace with:


if (json['success']) {
  window.location='index.php?route=checkout/checkout';
}

Extensions, OpenCart

Remove step 3 in checkout [vQmod]

A free vQmod that removes step 3 (delivery details) on the checkout page, adapted to work with Sellegance theme.

<modification>
 <id>Step 3 Checkout (Sellegance, Clearshop OpenCart 1.5.6.x)</id>
 <version>1.3</version>
 <vqmver>1.0.8</vqmver>
 <author>ffct.cc</author>
 
 <file name="catalog/view/theme/*/template/checkout/checkout.tpl">
 <operation>
 <search position="replace"><![CDATA[
 <section id="shipping-address"
 ]]></search>
 <add><![CDATA[
 <section id="shipping-address" style="display: none"
 ]]></add>
 </operation>
 
 <operation>
 <search position="replace"><![CDATA[
 $('#shipping-address .checkout-content').slideDown('slow');
 ]]></search>
 <add><![CDATA[
 $("#shipping-existing select").prop("selectedIndex", $("#payment-existing select").prop("selectedIndex"));
 $('#shipping-address #button-address').click();
 $('#button-shipping-address').click();
 ]]></add>
 </operation>
 </file>

 <file name="catalog/view/theme/*/template/checkout/guest.tpl">
 <operation>
 <search position="replace"><![CDATA[
 <label for="shipping">
 ]]></search>
 <add><![CDATA[
 <label for="shipping" style="display: none">
 ]]></add>
 </operation>
 </file>

 <file name="catalog/view/theme/*/template/checkout/register.tpl">
 <operation>
 <search position="replace"><![CDATA[
 <label for="shipping" class="label-group">
 ]]></search>
 <add><![CDATA[
 <label for="shipping" class="label-group" style="display: none">
 ]]></add>
 </operation>
 </file>
</modification>


Original: http://forum.opencart.com/viewtopic.php?f=131&t=49258

Knowledge Base, OpenCart

Add HTML support in attributes text

<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<tr>
  <th><?php echo $attribute['name']; ?></th>
  <td><?php echo $attribute['text']; ?></td>
</tr>
<?php } ?>
<?php foreach ($attribute_group['attribute'] as $attribute) { ?>
<tr>
  <th><?php echo $attribute['name']; ?></th>
  <td><?php echo html_entity_decode($attribute['text'], ENT_QUOTES, 'UTF-8');></td>
</tr>
<?php } ?>
Blog

Sellegance 1.3.4

A new version is out with important updates.

Improved compatibility with RTL languages. A new stylesheet will be loaded (stylesheet.rtl.css) when a RTL language is used.
Files changed: header.tpl, stylesheet.rtl.css

In a previous version the code loading extra links like the canonical tag was removed. This problem has been fixed in this release.
Files changed: header.tpl

Alignment fixes in currency and language selector when the logo is placed on the left.
Files changed: stylesheet.css

Reupload the files to update your theme.