Loaded Commerce Community

Banner


Board index » CRE Loaded Support » CRE Loaded 6.3

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Adding a "add to cart" with options to top and bottom of
PostPosted: Sun Jul 10, 2011 10:21 pm 
Offline
CRE Talented

Joined: Thu Dec 25, 2008 5:09 pm
Posts: 489
Location: CO
...the product_info_tpl.php file.

The product descriptions I have are pretty big (or can be). So I would like people to be able to choose the attributes and add the item to the cart from either the top of the page or the bottom.

When I attempted to put the same code at the top of the page I then received errors about unexpected { on the page... that then ran me down a rabbit hole of other bad coding on my part and more errors.

Anyone guide me on the proper way to accomplish having the attributes and add to cart button on both the top and bottom?

Thank you,
Mike


Top
 Profile  
 
 Post subject: Re: Adding a "add to cart" with options to top and bottom of
PostPosted: Sun Jul 10, 2011 10:42 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2405
Location: New Zealand
Hi Mike

Well, you can get the idea of how to duplicate the add to cart button from this thread:
http://creloaded.org/forum/82/28625.html

The attributes block is basically this:
Code:
$products_id_tmp = $product_info['products_id'];
            if(tep_subproducts_parent($products_id_tmp)){
              $products_id_query = tep_subproducts_parent($products_id_tmp);
            } else {
              $products_id_query = $products_id_tmp;
            }
            if ((defined('PRODUCT_INFO_SUB_PRODUCT_ATTRIBUTES') && PRODUCT_INFO_SUB_PRODUCT_ATTRIBUTES != 'True') || $product_has_sub == '0'){
              include(DIR_WS_MODULES . 'product_info/product_attributes.php');
            }

which means it's tangled up in subproducts as well (whether you use them or not.) So the most important line:
Code:
include(DIR_WS_MODULES . 'product_info/product_attributes.php');

is of course the file /includes/modules/product_info/product_attributes.php which you might want to check to see how it's laid out, before pasting the block in at the top of the page (inside the <form></form> tags of course.)

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
 Post subject: Re: Adding a "add to cart" with options to top and bottom of
PostPosted: Mon Jul 11, 2011 6:33 pm 
Offline
CRE Talented

Joined: Thu Dec 25, 2008 5:09 pm
Posts: 489
Location: CO
Hi Simon,

It looks like that might be a difference between 6.3.3 and 6.4.x in 6.3.3 this is the code call for the attributes:

Code:
            $attributes = new creAttributes();
            if ($attributes->load($product_info['products_id'])) {
              $options_HTML = $attributes->get_HTML();
// begin show product options
              if (count($options_HTML) > 0) {
              ?>
          <tr>
            <td>
              <table width="65%" border="0" cellspacing="0" cellpadding="2">
                <tr>
                  <td class="main" colspan="2"><strong><?php echo TEXT_PRODUCT_OPTIONS; ?></strong></td>
                </tr>
<?php
                foreach ($options_HTML as $op_data) {
                ?>
                <tr>
                  <td class="main" colspan="2"><?php echo $op_data['label']; ?></td>
                  <td class="main" colspan="2"><?php echo $op_data['HTML'];  ?></td>
                </tr>
<?php
                } //end of foreach
                ?>
             </table>
            </td>
          </tr>
<?php
              }  // end of count
            }
// end of product options new attributes



And when I paste this same code in two spots I get errors.

Mike.


Top
 Profile  
 
 Post subject: Re: Adding a "add to cart" with options to top and bottom of
PostPosted: Mon Jul 11, 2011 6:40 pm 
Offline
CRE Legend
User avatar

Joined: Thu Jun 12, 2008 6:39 am
Posts: 2405
Location: New Zealand
Sure - this'll take time, depending on how you tackle the errors.

Simon

_________________
www.codemehappy.com
For Cre Loaded tips, how-to articles and more


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

Board index » CRE Loaded Support » CRE Loaded 6.3

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Thu May 24, 2012 1:50 pm
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

Login

Forums Latest Activity

Top Listing

1. Cart2Cart - Shopping...
    Category: Shopping Cart Database Conversion Scripts
    
2. Points & Rewards PLUS!...
    Category: Add-Ons
    
3. Configuration Server...
    Category: Fixes
    
4. Credit Card with CCV
    Category: Payment Modules
    
5. CC7333_ATS
    Category: Templates
    
Show more...

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy