Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Advanced Cartbox


Beer Monster

Recommended Posts

Hi Folks,

 

Matti (Johnson) has asked me to open a support thread for this contribution as all the questions are going to the announcements channel at the moment!

 

Any questions/suggestions here please! :D

 

Beer!

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

Hi Folks,

 

Matti (Johnson) has asked me to open a support thread for this contribution as all the questions are going to the announcements channel at the moment!

 

Any questions/suggestions here please!  :D

 

Beer!

 

Good Idea! I am still working on figuring out the missing box border issue when an item is placed in the cart. While playing around with it I hard coded a "fake" box border. This works ok in IE but looks bad in FFox.

 

I also added an edit button to the box as well. I love this contribution. It make the cart box much more pro. looking. Thanks A million for this! :thumbsup:

 

Still working on my site so I cant give the URL but here is a screenshot of the new box.

 

screenshot.gif

Link to comment
Share on other sites

Don't worry about the border, I'm on the case. Spent a few hours improving the code in the cartbox. Will upload a modification later today!

 

Your screenshot is very impressive. You've got a lot more artistic talent than me!!

Edited by Beer Monster

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

I've uploaded a new version of the advanced cartbox to the contributions section.

 

http://www.oscommerce.com/community/contributions,3474

 

Hopefully the teething troubles have been sorted out now. I've also added a checkout button at the bottom.

 

Also, you can display micro thumbnails in the cart by removing the comment from line 110 in shopping_cart.php!

 

screenshot1.jpg ........... screenshot2.jpg

Brian

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

I've uploaded a new version of the advanced cartbox to the contributions section.

 

http://www.oscommerce.com/community/contributions,3474

 

Hopefully the teething troubles have been sorted out now. I've also added a checkout button at the bottom.

 

Also, you can display micro thumbnails in the cart by removing the comment from line 110 in shopping_cart.php!

 

screenshot1.jpg ...........  screenshot2.jpg

Brian

 

Hi Brian,

 

I finally had time to load the new changes. The boxes look much better but the page is loading rather slow now. It lingers as it's loading the shopping cart. Any ideas why this might be? It looks great now though. Excellent contribution. :thumbsup:

Link to comment
Share on other sites

Hi Brian,

 

I finally had time to load the new changes. The boxes look much better but the page is loading rather slow now. It lingers as it's loading the shopping cart. Any ideas why this might be? It looks great now though. Excellent contribution. :thumbsup:

 

The only thing I can think of is if you are using the tiny images as they are just the normal product list images shrunk down but that would mean your product list is slow too.

 

I'm working on my local machine at the moment so for me it displays pretty instantly. I'll have a look though and get back to you!

 

Brian

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

Hi. i get a "script error" when i try to increase or decrease the qty and if i try to remove the product.

furter more the qty field is very long

 

also, i would be very interested in having the edit button available

 

cartbox.gif

 

Im using STS template system

Link to comment
Share on other sites

Hi. i get a "script error" when i try to increase or decrease the qty and if i try to remove the product.

furter more the qty field is very long

 

also, i would be very interested in having the edit button available

 

 

Im using STS template system

 

The size of the quantity box indicates that you haven't added the necessary styles to the stylesheet.

 

You'll need to be more specific on the script error!!!

 

It could be that you already have macromedia rollover code included in your site (in which case you don't need the included .js file) or you've put the .js file in a different location to that specified in the install instructions.

 

 

Brian

Edited by Beer Monster

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

Hi. i get a "script error" when i try to increase or decrease the qty and if i try to remove the product.

furter more the qty field is very long

 

also, i would be very interested in having the edit button available

 

Im using STS template system

 

Actually, it is the STS that's causing the problem! This is the first time I've seen STS and while it's impressive, I can't say I like what it does. Maybe if I understood it better.....

 

Ok, here's how to fix it!

 

At the top of includes/boxes/shopping_cart just above the first <script> tag add

<tr>

<td><table></table>

 

and just below the <body onload..... tag remove

 

<tr>

<td>

 

That's your javascript errors fixed!

 

Now for the quantity box:

 

The style for this needs to go in the includes\sts_templates\mysite\stylesheet.css file.

 

Here is the style to add

INPUT.quantitybox {
 border: 1px;
 border-style: solid;
 border-color: #000000;
   font-size: 12px;
 width: 20px;
 height: 22px;
 border-spacing: 0px;
 background: #F8f8f9;
}

 

You will have to ask Chardae nicely for the edit button though!

 

Brian

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

Very awsome Monster.

i owe you a 6pack.

thank you so much for the help even taking your time to install STS just to help out

the only problem im left with is the border issue. is there a sollution to it ?

 

 

The border issue should be fixed in the version you are using!

 

Check that the cartbox class in includes/classes/boxes.php is identical to the infobox class with the following exception:

 

function infoBoxContents($contents) {

$this->table_cellpadding = '0';

 

The cellpadding in the cartbox class's infoboxcontents function must be '0'. In order to match the rest of your site, everything else should be the same as the infobox class (Under normal circumstances anyway).

 

Secondly, check that you are using the class="infoBoxContents" style in your other infoboxes if not, then you should change all instances of class="infoBoxContents" (4 of them) in includes/boxes/shopping_cart.php to be the same as the other infoboxes.

 

If none of that works let me know and I'll try to think of something else. A url to your site would be helpful if available!

 

Cheers,

 

Beer

Edited by Beer Monster

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

Cool contrib, but is there a way to get it to look right with the drop shadow contrib?

 

Notice how the cartbox looks compared to the boxes under it:

 

screenie9qf.jpg

 

And it's not possible to have just a little cellpadding?

Edited by jeffy777
Link to comment
Share on other sites

also, the quantity fields are short in IE, but long in firefox, even with the additions to the stylesheet.

 

Thanks again for your work on this!

 

I'll look at your problems with that contrib.

 

As for the quantity being long in firefox, It's the same size in IE, Firefox and opera for me so I'm a little confused there. Hopefully it's something to do with your shadow contrib and I can sort both at the same time.

 

As for the padding, you can have it but it will separate the up/down buttons from the quantity box which doesn't look so good. I'm sure there will be a way around it, I just don't know what it is at the moment.

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

also, the quantity fields are short in IE, but long in firefox, even with the additions to the stylesheet.

 

Thanks again for your work on this!

 

in function cartbox, set the cellpadding to zero. (includes/classes/boxes.php)

    function cartBox ($contents) {
     $info_box_contents = array();
     $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
     $this->table_cellpadding = '0';
     $this->table_parameters = 'class="infoBox"';
     $this->tableBox($info_box_contents, true);
   }

 

Doesn't look like you are going to get your cell padding with either contrib!!!!

 

As for the quantitybox, I have no idea why you're having a problem with firefox but if you have any more info (or a url to your site) let me know.

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

Thanks for looking into the cellpadding issue. I just like to have some padding around the edge, or it looks too compressed. I have a little bit of padding with the standard dropshadow contrib, so the other boxes look less compacted then the advanced cartbox.

Edited by jeffy777
Link to comment
Share on other sites

Thanks for looking into the cellpadding issue. I just like to have some padding around the edge, or it looks too compressed. I have a little bit of padding with the standard dropshadow contrib, so the other boxes look less compacted then the advanced cartbox.

 

I'm not sure you get what i'm saying. To fix the problem with the shadow you must set the cellpadding to zero in function cartbox. (includes/classes/boxes.php)

   function cartBox ($contents) {
    $info_box_contents = array();
    $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
    $this->table_cellpadding = '0';
    $this->table_parameters = 'class="infoBox"';
    $this->tableBox($info_box_contents, true);
  }

 

It was set at 1 and this is why it looked different to the other boxes!!

 

As for getting some spacing, you can add   in the appropriate places eg before Qty and after the price etc...

Edited by Beer Monster

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

yes, I got what you were saying, sorry for being confusing :) I was just commenting on the fact that the rest of the boxes have a little cellpadding, which makes the cartbox looked cramped. I'll trying adding the spaces in there to see how it looks.

 

Thanks again!

Link to comment
Share on other sites

ok.. I got the Advanced CartBox to work except that when I go to add something from the xsell mod ... ("We also recommend") box in the bottom it just adds another product from the page you were on.

 

http://www.buybuttonparts.com/shop/1434-st...r-kit-p-57.html

 

This is a product for example where it goofs up... add one of these kits to your cart and then go down to the recommended product and try to add one of those in. It just doubles the quantity of the original product.

 

Any help would be greatly appreciated as I love this cart add on.

Link to comment
Share on other sites

ok.. I got the Advanced CartBox to work except that when I go to add something from the xsell mod ... ("We also recommend") box in the bottom it just adds another product from the page you were on.

 

http://www.buybuttonparts.com/shop/1434-st...r-kit-p-57.html

 

This is a product for example where it goofs up... add one of these kits to your cart and then go down to the recommended product and try to add one of those in. It just doubles the quantity of the original product.

 

Any help would be greatly appreciated as I love this cart add on.

 

I've had a look and I'm not sure that your problem has anything to do with the cartbox at all.

 

All the buy now buttons in your x-sell box have the same product id (57) as the product being viewed in the product_info page

 

<td align="center" class="smallText" width="33%" valign="top"><a href="http://www.buybuttonparts.com/shop/250-complete-badgeaminit-compatible-p-800.html"><img src="images/225-new.jpg" border="0" alt="250 - 2 1/4" Complete - Badge-A-Minit Compatible" title=" 250 - 2 1/4" Complete - Badge-A-Minit Compatible " width="100" height="80"></a><br><a href="http://www.buybuttonparts.com/shop/250-complete-badgeaminit-compatible-p-800.html">250 - 2 1/4" Complete - Badge-A-Minit Compatible</a><br>$24.00<br><a href="http://www.buybuttonparts.com/shop/index.php?products_id=57&action=buy_now"><img src="includes/languages/english/images/buttons/button_buy_now.gif" border="0" alt="TEXT_BUY250 - 2 1/4" Complete - Badge-A-Minit CompatibleTEXT_NOW" title=" TEXT_BUY250 - 2 1/4" Complete - Badge-A-Minit CompatibleTEXT_NOW " width="60" height="14"></a></td>

    <td align="center" class="smallText" width="33%" valign="top"><a href="http://www.buybuttonparts.com/shop/500-complete-badgeaminit-compatible-p-801.html"><img src="images/225-new.jpg" border="0" alt="500 - 2 1/4" Complete - Badge-A-Minit Compatible" title=" 500 - 2 1/4" Complete - Badge-A-Minit Compatible " width="100" height="80"></a><br><a href="http://www.buybuttonparts.com/shop/500-complete-badgeaminit-compatible-p-801.html">500 - 2 1/4" Complete - Badge-A-Minit Compatible</a><br>$38.00<br><a href="http://www.buybuttonparts.com/shop/index.php?products_id=57&action=buy_now"><img src="includes/languages/english/images/buttons/button_buy_now.gif" border="0" alt="TEXT_BUY500 - 2 1/4" Complete - Badge-A-Minit CompatibleTEXT_NOW" title=" TEXT_BUY500 - 2 1/4" Complete - Badge-A-Minit CompatibleTEXT_NOW " width="60" height="14"></a></td>

 

That's the same product_id as your 2 1/4" Starter Kit!

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

ok ok .. Sorry about that. It did not have to do with the cartbox. It was the X-Sell Mod all along.

 

I just updated that and it works for me except that when I have the "return to cart" on off it says "product not found". I am sure that is a X-Sell bug once again.

 

Thanks for looking at it though!

 

Lyle

Link to comment
Share on other sites

Love this little contrib - Much nicer than stock version

 

As suggested I added   in a few places - And it works wonderfully

 

Except in Mozilla

 

For some reason, Mozilla treats the   placed before Qty as characters and displays &nbsp. Yet all others are shown as <spaces>.

 

      $products_form ='    <tr>' .
// Added   to below line before Qty so it was not hard against frame    
                    '      <td>&nbspQty </td>' .
                    '      <td> ' . $extra_elements . tep_draw_input_field..............

 

Would be so much easier if only had to please one browser - or if M$ didn't decide to do their own thing !

 

Any suggestions are greatly appreciated :)

Link to comment
Share on other sites

Love this little contrib - Much nicer than stock version

 

As suggested I added   in a few places - And it works wonderfully

 

Except in Mozilla

 

For some reason, Mozilla treats the   placed before Qty as characters and displays &nbsp. Yet all others are shown as <spaces>.

 

      $products_form ='    <tr>' .
// Added   to below line before Qty so it was not hard against frame    
                    '      <td>&nbspQty </td>' .
                    '      <td> ' . $extra_elements . tep_draw_input_field..............

 

Would be so much easier if only had to please one browser - or if M$ didn't decide to do their own thing !

 

Any suggestions are greatly appreciated :)

 

You forgot to put ';' behind your first   ;)

Link to comment
Share on other sites

  • 1 month later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...