open cart tips (for versions before 2.+)

Let us talk about scripts, HTML, Perl, PHP, apache, etc.
User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:
open cart tips (for versions before 2.+)

Post by Stevyn » Sun Jan 06, 2013 12:07 pm

Remove Currency & Language Drop-Downs Altogether

Admin -> System -> Localisation ->

edit currency and language to disable all but usa dollars
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:

Re: open cart tips

Post by Stevyn » Sun Jan 06, 2013 12:13 pm

Remove Wishlist

from front screen:

edit header.tpl and remove wishlist option


perhaps more infos:


http://forum.opencart.com/viewtopic.php ... 20#p346590

Near the top of your stylesheet css (before #header), insert these lines:

Code: Select all

    /* Hide wishlist and compare sections */
    .wishlist {
       display:none;
    }
    .compare {
       display:none;
    }
Go to theme>default>template>product>product.tpl, -comment these lines (around line 207):

Code: Select all

            <!--
            <div><span><?php echo $text_or; ?></span></div>
            <div><a onclick="addToWishList('<?php echo $product_id; ?>');"><?php echo $button_wishlist; ?></a><br />
              <a onclick="addToCompare('<?php echo $product_id; ?>');"><?php echo $button_compare; ?></a></div>
            --> 
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:

Re: open cart tips

Post by Stevyn » Sun Jan 06, 2013 12:52 pm

delete title Powered By OpenCart?

edit footer.tpl
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:

Re: open cart tips

Post by Stevyn » Sun Jan 20, 2013 10:04 am

Opencart Grid View by Default

http://www.itsadam.co.uk/opencart-grid-view-by-default/

Code: Select all

This is a tutorial or how to guide to help you make OpenCart 1.5 display the grid view by Default.

This is really really simple and easy to do, and why there’s no option in the OpenCart Admin Area to specify this is beyond me, however.
Open > your themes folder > template > common > footer.tpl

And then before </body>

Add this code:

<script type="text/javascript">$(document).ready(function() { display('grid'); });</script>
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:

Re: open cart tips

Post by Stevyn » Thu Jan 31, 2013 12:31 pm

open cart disable accounts and skip to address in checkout - 1.5

http://forum.opencart.com/viewtopic.php?f=20&t=36157

My solution for skipping step 1 in the checkout process:

checkout/login.tpl
in login.tpl insert this at the top, its javascript in jquery syntax and need to be enclosed in a <script> tag

Code: Select all

       <script language="Javascript" type="text/javascript">
 $('input[name=account]:eq(1)').attr('checked', 'checked');
      $('#button-account').trigger('click');
</script>


stylesheet. main stylesheet is stylesheet.css, insert at top

Code: Select all

    #checkout {
       display: none;
    }

because this skips registration and hides step 1 alomost immeadiately without animation, you have to edit your language file though (step 2 is now step 1 etc.)
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:

Re: open cart tips

Post by Stevyn » Thu Jan 31, 2013 3:31 pm

open cart Remove "What would you like to do next?"

http://forum.opencart.com/viewtopic.php ... 84#p313609

Open cart.tpl and find this line:

Code: Select all

    <h2><?php echo $text_next; ?></h2>
      <div class="content">
        <p><?php echo $text_next_choice; ?></p>
        <table class="radio">
          <?php if ($coupon_status) { ?>
          <tr class="highlight">
            <td><?php if ($next == 'coupon') { ?>
              <input type="radio" name="next" value="coupon" id="use_coupon" checked="checked" />
              <?php } else { ?>
              <input type="radio" name="next" value="coupon" id="use_coupon" />
              <?php } ?></td>
            <td><label for="use_coupon"><?php echo $text_use_coupon; ?></label></td>
          </tr>
          <?php } ?>
          <?php if ($voucher_status) { ?>
          <tr class="highlight">
            <td><?php if ($next == 'voucher') { ?>
              <input type="radio" name="next" value="voucher" id="use_voucher" checked="checked" />
              <?php } else { ?>
              <input type="radio" name="next" value="voucher" id="use_voucher" />
              <?php } ?></td>
            <td><label for="use_voucher"><?php echo $text_use_voucher; ?></label></td>
          </tr>
          <?php } ?>
          <?php if ($reward_status) { ?>
          <tr class="highlight">
            <td><?php if ($next == 'reward') { ?>
              <input type="radio" name="next" value="reward" id="use_reward" checked="checked" />
              <?php } else { ?>
              <input type="radio" name="next" value="reward" id="use_reward" />
              <?php } ?></td>
            <td><label for="use_reward"><?php echo $text_use_reward; ?></label></td>
          </tr>
          <?php } ?>
          <?php if ($shipping_status) { ?>
          <tr class="highlight">
            <td><?php if ($next == 'shipping') { ?>
              <input type="radio" name="next" value="shipping" id="shipping_estimate" checked="checked" />
              <?php } else { ?>
              <input type="radio" name="next" value="shipping" id="shipping_estimate" />
              <?php } ?></td>
            <td><label for="shipping_estimate"><?php echo $text_shipping_estimate; ?></label></td>
          </tr>
          <?php } ?>
        </table>
      </div>
Replace it with this:

Code: Select all

     <div style="display:none;">
      <h2><?php echo $text_next; ?></h2>
      <div class="content">
        <p><?php echo $text_next_choice; ?></p>
        <table class="radio">
          <?php if ($coupon_status) { ?>
          <tr class="highlight">
            <td><?php if ($next == 'coupon') { ?>
              <input type="radio" name="next" value="coupon" id="use_coupon" checked="checked" />
              <?php } else { ?>
              <input type="radio" name="next" value="coupon" id="use_coupon" />
              <?php } ?></td>
            <td><label for="use_coupon"><?php echo $text_use_coupon; ?></label></td>
          </tr>
          <?php } ?>
          <?php if ($voucher_status) { ?>
          <tr class="highlight">
            <td><?php if ($next == 'voucher') { ?>
              <input type="radio" name="next" value="voucher" id="use_voucher" checked="checked" />
              <?php } else { ?>
              <input type="radio" name="next" value="voucher" id="use_voucher" />
              <?php } ?></td>
            <td><label for="use_voucher"><?php echo $text_use_voucher; ?></label></td>
          </tr>
          <?php } ?>
          <?php if ($reward_status) { ?>
          <tr class="highlight">
            <td><?php if ($next == 'reward') { ?>
              <input type="radio" name="next" value="reward" id="use_reward" checked="checked" />
              <?php } else { ?>
              <input type="radio" name="next" value="reward" id="use_reward" />
              <?php } ?></td>
            <td><label for="use_reward"><?php echo $text_use_reward; ?></label></td>
          </tr>
          <?php } ?>
          <?php if ($shipping_status) { ?>
          <tr class="highlight">
            <td><?php if ($next == 'shipping') { ?>
              <input type="radio" name="next" value="shipping" id="shipping_estimate" checked="checked" />
              <?php } else { ?>
              <input type="radio" name="next" value="shipping" id="shipping_estimate" />
              <?php } ?></td>
            <td><label for="shipping_estimate"><?php echo $text_shipping_estimate; ?></label></td>
          </tr>
          <?php } ?>
        </table>
      </div>
      </div>
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:

Re: open cart tips

Post by Stevyn » Fri Feb 22, 2013 8:57 am

fix the opencart "add to cart button" notworking bug:

http://shopencart.com/add-to-cart-not-w ... ome?page=2

A very common problem that many users encounter is the Add to Cart sometimes not working on their site homepage.

The problem is related to the url of the store. A website can be accessed trough adress like: example.com as well as http://www.example.com

When you first install opencart, the base of the website is going to be written in config.php, but it can only be one: either example.com or http://www.example.com (depends on the adress you accessed the installation in the first place). So if you install your store by going to example.com, then the base of your website in config.php will be example.com. So here is the origin of the problem, because if you then access your store via http://www.example.com , the add to cart wont work on the homepage.

To fix this problem, you can make a redirect in htaccess from http://www.example.com to example.com or the other way around (depends on which case applies to you).

First, to make a redirect from non www to www adress (ex: from example.com to http://www.example.com), edit the .htaccess from your opencart root and find the line:

Code: Select all

RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]
and then add this:

Code: Select all

# FORCE WWW IN URL
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
# END FORCE WWW IN URL 

if your cart is in a subfolder like example.com/cart/ do this:

Code: Select all

# FORCE WWW IN URL
RewriteCond %{HTTP_HOST} !^www\.example\.com [NC]
RewriteRule ^(.*)$ http://www.example.com/cart/$1 [R=301,L]
# END FORCE WWW IN URL 
to remove the www from the url

Code: Select all

# FORCE nonWWW IN URL
 RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:

Re: open cart tips

Post by Stevyn » Sat Mar 09, 2013 3:38 pm

opencart remove weight in checkout

http://forum.opencart.com/viewtopic.php?f=20&t=61616

v1.5.2.1
Open catalog/model/shipping/weight.php

Find this line: (array)

Code: Select all

    $quote_data['weight_' . $result['geo_zone_id']] = array(
                      'code'         => 'weight.weight_' . $result['geo_zone_id'],
                      'title'        => $result['name'] . '  (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')',
                      'cost'         => $cost,
                      'tax_class_id' => $this->config->get('weight_tax_class_id'),
                      'text'         => $this->currency->format($this->tax->calculate($cost, $this->config->get('weight_tax_class_id'), $this->config->get('config_tax')))
                   );
Make it look like this and you will get what you want:

Code: Select all

    $quote_data['weight_' . $result['geo_zone_id']] = array(
                      'code'         => 'weight.weight_' . $result['geo_zone_id'],
                      'title'        => $result['name'],
                      //'title'        => $result['name'] . '  (' . $this->language->get('text_weight') . ' ' . $this->weight->format($weight, $this->config->get('config_weight_class_id')) . ')',
                      'cost'         => $cost,
                      'tax_class_id' => $this->config->get('weight_tax_class_id'),
                      'text'         => $this->currency->format($this->tax->calculate($cost, $this->config->get('weight_tax_class_id'), $this->config->get('config_tax')))
                   );   
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:

Re: open cart tips

Post by Stevyn » Sun Jun 30, 2013 6:25 am

remove or swap opencart logo

in the admin area go to SYSTEM -> SETTINGS -> IMAGE TAB

or edit the file header.tpl
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

User avatar
Stevyn
SysOp
Posts:1773
Joined:Mon Nov 09, 2009 10:03 am
Location:Japan
Contact:

Re: open cart tips

Post by Stevyn » Sun Jun 30, 2013 8:45 am

Customising the OpenCart navigation bar

see http://www.jackwdavis.com/2012/02/18/cu ... ation-bar/

edit header.tpl

Code: Select all

<?php if ($categories) { ?>
<div id="menu">
  <ul>
    <?php foreach ($categories as $category) { ?>
    <li><a href="<?php echo $category['href']; ?>"><?php echo $category['name']; ?></a>
      <?php if ($category['children']) { ?>
      <div>
        <?php for ($i = 0; $i < count($category['children']);) { ?>
        <ul>
          <?php $j = $i + ceil(count($category['children']) / $category['column']); ?>
          <?php for (; $i < $j; $i++) { ?>
          <?php if (isset($category['children'][$i])) { ?>
          <li><a href="<?php echo $category['children'][$i]['href']; ?>"><?php echo $category['children'][$i]['name']; ?></a></li>
          <?php } ?>
          <?php } ?>
        </ul>
        <?php } ?>
      </div>
      <?php } ?>
    </li>
    <?php } ?>

  <!-- Insert your new links here  -->
   <li><a href="http://www.yourstore.com/factory">Our Factory</a></li>

  </ul>
</div>
<?php } ?>

or just add only your links by getting rid of catagory loop
Contact me directly: Ironfeatherbooks (@) gmail.com

Image

Post Reply