Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Advanced Cartbox


Beer Monster

Recommended Posts

Anyone know how to get this to work with the inbox skins contrib.

May shopping cart is skinned until I add something to it.

then it switches to the advanced cartbox and the skin gets turned off.

 

any thoughts?

 

Most of these skinning contribs make changes to the infobox class in includes/classes/boxes.php

 

To make the cartbox work with such contribs, you will need to make corresponding changes to the cartbox class.

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

If anyone would like to use advanced Cartbox with infobox skins

 

Instead of the code in the install.txt

paste the following code In catalog/includes/classes/boxes.php before the last ?> tag:

 

//BOF: Advanced Cartbox Version 
 class cartBox extends tableBox {
function cartBox ($contents) {
 global $infobox_header_text, $infobox_header_link;
  $info_box_contents = array();
		if (SKIN_INFOBOX_ACTIVE == 'true'){
  $info_box_contents[] = array('text' => $this->newinfoBoxContents($contents));
	  //reset globals as these should only be used once!
		$infobox_header_text = '';
		$infobox_header_link = false;
		}	else {
  $info_box_contents[] = array('text' => $this->infoBoxContents($contents));
  $this->table_cellpadding = '1';
  $this->table_parameters = 'class="infoBox"';
		}
  $this->tableBox($info_box_contents, true);
}

function infoBoxContents($contents) {
  $this->table_cellpadding = '3';
  $this->table_parameters = 'class="infoBoxContents"';
  $info_box_contents = array();
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
	$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
									   'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
									   'params' => 'class="boxText"',
									   'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
  }
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  return $this->tableBox($info_box_contents);
}

		function newinfoboxcontents($contents) {
		global $infobox_header_text, $infobox_header_link, $skin_slice_set;
	  $this->table_cellpadding = '0';
		$this -> align = 'center';
  $info_box_contents = array();
  $info_box_contents[] = array(array('text' => tep_draw_separator('pixel_trans.gif', '100%', '1')));
  for ($i=0, $n=sizeof($contents); $i<$n; $i++) {
	$info_box_contents[] = array(array('align' => (isset($contents[$i]['align']) ? $contents[$i]['align'] : ''),
									   'form' => (isset($contents[$i]['form']) ? $contents[$i]['form'] : ''),
									   'params' => 'class="boxText"',
									   'text' => (isset($contents[$i]['text']) ? $contents[$i]['text'] : '')));
  }

  if ($infobox_header_link != false) {
  $infobox_link = '<a href="' . $infobox_header_link . '">' . tep_image(DIR_WS_IMAGES . 'infobox/arrow_right.gif', ICON_ARROW_RIGHT) . '</a>';
  }	
  return $this->tableBox($info_box_contents, false, true, $infobox_header_text, $infobox_header_link, $skin_slice_set);

}
 }
 //EOF: Advanced Cartbox Version

Link to comment
Share on other sites

Very good contribution, however I have a slight problem.

 

I use a contribution to discount certain members, however this isn't working well with the cart. The total amount displayed in the box is correct, but on the price after the individual products the discount rate is applied twice. Not just two times, but say I have a discount of 10%, the price listed after a product is $price * 0.90 * 0.90 (= 0.81 * $price) instead of $price * 0.90. Any solutions?

Link to comment
Share on other sites

Very good contribution, however I have a slight problem.

 

I use a contribution to discount certain members, however this isn't working well with the cart. The total amount displayed in the box is correct, but on the price after the individual products the discount rate is applied twice. Not just two times, but say I have a discount of 10%, the price listed after a product is $price * 0.90 * 0.90 (= 0.81 * $price) instead of $price * 0.90. Any solutions?

 

Which discount contribution are you using?

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

  • 5 months later...

hi.

 

awsome contrib.

 

my problem. i use STS 4.1 and after install this contrib

i got SCRIPT errors

i can not change the quantity also i can not delete items from the cartbox and the rollover-pictures are not working.

 

Any solution for this problems ?

 

 

bg

Michael

Link to comment
Share on other sites

hi.

 

awsome contrib.

 

my problem. i use STS 4.1 and after install this contrib

i got SCRIPT errors

i can not change the quantity also i can not delete items from the cartbox and the rollover-pictures are not working.

 

Any solution for this problems ?

bg

Michael

 

See my post re. STS on the previous page of this topic!!

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

  • 2 months later...

good contrib but i have installed and not work

 

the increment product not work, and the remove not work.

 

I have downloaded de last version when say that error is fixeb but not work.

 

Any help is apreciated

 

i runnin my oscommerce on localhost for test..

 

Many tnx

Link to comment
Share on other sites

  • 2 weeks later...

Have you installed a template contribution?

 

good contrib but i have installed and not work

 

the increment product not work, and the remove not work.

 

I have downloaded de last version when say that error is fixeb but not work.

 

Any help is apreciated

 

i runnin my oscommerce on localhost for test..

 

Many tnx

Light, in the absence of eyes, illuminates nothing.

Link to comment
Share on other sites

  • 3 months later...

Hi.

 

Thank you Beer Monster for this hopeful contrib.

 

I have a problem. Some user told me that when they pass from a category to another the trash empties.

On my PC it perfectly works. I thought that maybe could be a problem related to cookies and security settings.

The shop is www.valpanera.it/shop

 

Any idea?

Thanks

Tommy

Link to comment
Share on other sites

I resolved.

 

It was an error about sessions. I put some buttons instead of the category menu, and I forgot to put in the link the session id, so everytime an user selected a category the session was empty and so was the cart.

 

It's not a bug relting this very good contrib. It was an error made by my modifications.

 

Thank you

Tommy

Link to comment
Share on other sites

  • 3 weeks later...
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

 

 

Interesting post this. It was the same symptoms that my site was displaying, the javascript non-working shopping_cart.php.

 

I did exactly as stated here, and yes, it did work beautifully. BUT, after that, when I went to checkout, it stayed on checkout_shipping.php, and would just loop, not going to checkout_payment.

 

ANy ideas on this one? I can't see why this should affect the checkout process, but when I put the standard cart box back, the system worked fine again.

Link to comment
Share on other sites

  • 1 month later...

I have been using your excellent contribution and I have to say it is fantastic. It does exactly what I was looking for.

 

However I have found that it does not work correctly when installed with Chemos Page Cache Class.

 

The error occurs, of course, when users are not logged in and when they have items in their cart, and involves mulitple product listings in the cart..

 

Apon viewing shopping_cart.php, create_account.php, login.php, order_info.php (PWA), and various other pages, the items in the cart are shown twice.

 

For example if you have 2 items then each of them is listed twice, all with quantities of one, the checkout button is also duplicated, giving a total of four items in the cart and two checkout buttons.

 

I think this means that it must be all of the infobox contents is duplicated somwhere or displayed twice.

 

Once this error is triggered by the pages mentioned above it persists until a user had created an account, logged in or reached checkout_shipping.php (PWA).

 

On shopping_cart.php the quantity changes made in the central shopping cart module work fine, applying to all items, including the duplicates. They do not work from the cart infobox.

 

Please could you help me out fixing this problem? Or point me to a forum post that will help out?

 

I think this is a fantastic contribution and I badly want it operating on my store!

 

Thanks a lot in advance, :thumbsup:

 

Scottman

Link to comment
Share on other sites

  • 2 years later...
  • 9 months later...

hi

this is a question for beer monster....i used your advanced cart box upload via oscommerce addons....now it works fine so far in safari..but the button-up and down shift position(to the left) in firefox when i click through the shop pages...how can i resolve this? i did add a float:left into my css but no joy.

 

regards

 

leoneonekenobi

Link to comment
Share on other sites

  • 1 month later...

good contrib but i need help for this function

 

function decrement(index) {

if(document.forms["cart_box"].elements["cart_quantity[]"][index].value >3) {

document.forms["cart_box"].elements["cart_quantity[]"][index].value-=3;

document.cart_box.submit();

}

}

 

function increment(index) {

document.forms["cart_box"].elements["cart_quantity[]"][index].value++;

document.cart_box.submit();

}

 

as you see in the "function decrement" of each of clicks, it decreases qty 3 (-3) and the function of each clicked incrementnya increases 1 (+1)

 

Because I am not a programmer

I need help to change the function of incrementnya into +3

 

Thanks before

Link to comment
Share on other sites

  • 1 month later...

Trying to install this and am getting an error message

 

Fatal error: Class 'cartBox' not found in /services3/webpages/p/a/paintballwarehouseny.com/public/includes/boxes/shopping_cart.php on line 167

 

Can anyone tell me what I am missing? I have InfoBox Customizer which allows for customizing of the box through stylesheet. But I don't believe this is causing the problem because all that does is change the class for the styles.

 

Would really appreciate any input - I have been going around for hours on this one.

 

Thanks

Sue

Link to comment
Share on other sites

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...