Kryptronic Software Support Forum

You are viewing this forum as a guest. Login to an existing account, or create a new account, to reply to topics and to create new topics.

#1 06-05-2007 17:08:49

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Update cart quantity from product display.

I've been struggling with the question for days and have not come up with the way to do this. Maybe it can't be done without major hacks. Here's the problem:

On the product display the size options are in selection lists:

Small*       Medium*
0               0
1               1
2               2
3               3
4               4
5               5            ...etc.

So, if they want 2 smalls, they select 2 in the small selection list. Easy.

The problem is that if they click 'add to cart' without updating the quantity they will get an empty cart, although the size selections will show up, just not in the quantity box. BTW, the quantity field is also a selection list 0-10. All selection lists are set to zero.

I modified form_footer.php to add a update cart button in the product display, but I'm not sure that's actually accomplishing anything, probably not. It prints like this:

Code:

<input class="khxc_formbutton" name="SUBMIT" id="ccp0--prodaddtocart--SUBMIT" value="Update Quantities" onclick="return DisableSubmit('ccp0--prodaddtocart');" type="submit">

That's not right, but I'm not sure what needs to change.

Now the data from there gets used by cartdisplay.php, right? If so, how would I edit cartdisplay.php to use the data and update the quantity field in the cart.

I used print_r(array_chunk($cart,2,true)); (thanks, John aka:dh783 for that) to see what was in the array and this is what I got:

Array ( [0] => Array ( [0] => Array ( [randid] => 2ensyxp6owbm [id] => Starry_Night_t-shirt [quantity] => 2 [name] => Starry Night [number] => 100-25 [imgsm] => 100-25sml.jpg [prodinv] => 0 [optdisp] => Array ( [Small] => 0 [Medium] => 0 [Large] => 2 [X-Large] => 0 [XX-Large] => 0 [Youth Small (6-8)] => 0 [Youth Medium (10-12)] => 0 [Youth Large (14-16)] => 0 ) [optselids] => small.0, medium.0, large.2, xlarge.0, xxlarge.0, youthsmall.0, youthmedium.0, youthlarge.0 [optinv] => [dlfiles] => [delmethod] => C [sinshipinfo] => Array ( [customship] => user [shiplength] => 10 [shipwidth] => 8 [shipheight] => 1 [shipweight] => 0.5 [shipnumbox] => 0 [shipstateprov] => Illinois [shipcountry] => United States [shipzip] => 61087 [shiptype] => C ) [shipemail] => [sinprodprice] => Array ( [type] => R [displayb] => .00 [actualb] => 17.00 [displayr] => [actualr] => [displaybx] => [actualbx] => ) [sinoptprice] => Array ( [type] => R [displayb] => .00 [actualb] => 0.00 [displayr] => [actualr] => [displaybx] => [actualbx] => ) [sinaffcomm] => 0 [istaxsp] => 1 [istaxc] => 0 [subtotal] => 34 [subtotalrec] => 0 [url]=> INTERNAL [addemtext] => [savetype] => CART ) ) )

So, again, the question is can the selections from the size selection lists be used to update the cart quantity if the quantity is set to zero and can it be done without major hacks? And if so, can someone please point me in the right direction. I hope this post make some sense. If you need clarification, please don't hesitate to ask.

Thanks,

John

Last edited by JGB (06-05-2007 17:46:01)

Offline

 

#2 06-05-2007 22:20:53

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

From the product detail the information gets sent to CCP_Cart functions addcart then directed to either addcart_single, addcart_multipal which pull there information for ccp0_prod for the item, gets the quantity amount from product submit cgi and then inserted into the cart, or sent to addcart_remote (external page submit) which builds product info which then would send it to wright_order, then to build_item and back to wright_order to be inserted in the cart  (all of these are functions of CCP_Cart.php, and if I remember the order right).

Your problem if I understand it right is that you are tring to change the item quantity with an option field. The problem here is that the options script isn't concerned or doesn't control the cart quantity field so if your fields are being posted as an option input field they will not change the quantity with out a major code mod.

John

Offline

 

#3 06-06-2007 11:31:12

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

Your problem if I understand it right is that you are tring to change the item quantity with an option field. The problem here is that the options script isn't concerned or doesn't control the cart quantity field so if your fields are being posted as an option input field they will not change the quantity with out a major code mod.

Thanks, John. I understand that the options script doesn't control the cart quantity field, but if there is an array with all the pertinent info present in cartdisplay.php which generates the cart, can't the needed values be pulled out and used? Maybe I'm just not understanding arrays right.

-------------------
I was just looking over the script and realized that if there is more than one size selected it makes this script even more usless. So, with that in mind...please read on.
-----------------


This is the part of the array that has the info I'd like to use:
[optdisp] => Array ( [Small] => 0 [Medium] => 0 [Large] => 2 [X-Large] => 0 [XX-Large] => 0 [Youth Small (6-8)] => 0 [Youth Medium (10-12)] => 0 [Youth Large (14-16)] => 0 )

cartdisplay.php Line 341 has this code:

Code:

               print '<input class="khxc_quickfield" type="text" name="';
               print $app . '--updatecart--quantity--' . $cartdata['randid'];
               print '" id="' . $app . '--updatecart--quantity--' . $cartdata['randid'];
               print '" value="' . $cartdata['quantity'] . '" size="5" maxlength="5" />' . $eol;
               print '</td>' . $eol;

I've been trying to do a if...foreach...else statement with no luck. All I'm getting so far is the work 'Array' printed in the quantity field. Close, but no joy.

This is what I have so far (after you're done ROTFL wink, maybe you can give me a clue as to whether or not I'm heading in the right direction or wasting time):

Code:

           if ($cartdata['quantity'] == 0) { 
               
               $optquant = 0;
               
                     foreach ($cart as $num => $cartdata) {
               
                           if ($cartdata['optdisp']) {$optquant++;}
               
                     } // End of foreach statement.
       
               print '<input class="khxc_quickfield" type="text" name="';
               print $app . '--updatecart--quantity--' . $cartdata['randid'];
               print '" id="' . $app . '--updatecart--quantity--' . $cartdata['randid'];
               print '" value="' . $cartdata['optdisp'] . '" size="5" maxlength="5" />' . $eol;
               print '</td>' . $eol;
              
               } else {
               
               print '<input class="khxc_quickfield" type="text" name="';
               print $app . '--updatecart--quantity--' . $cartdata['randid'];
               print '" id="' . $app . '--updatecart--quantity--' . $cartdata['randid'];
               print '" value="' . $cartdata['quantity'] . '" size="5" maxlength="5" />' . $eol;
               print '</td>' . $eol;
              
               } // End of if statement.

Maybe I don't need an update button at all. Maybe a script like this could take the 'add to cart' submission and do what is needed. If this doesn't work I will consider the matter dead and tell the boss it can't be done...unless Nick can do it in his sleep and I can then just get a quote.

Thanks,

John

Last edited by JGB (06-06-2007 11:56:19)

Offline

 

#4 06-06-2007 14:07:52

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

What you would have  to do with what you have in an if statement like:

Code:

if ($optdisp['Small'] > 0) {

     $cartdata['quantity'] = $optdisp['Small'];

} else if ($optdisp['Medium'] > 0) {

   $cartdata['quantity'] = $optdisp['Medium'];

} else if ($optdisp['Large'] > 0) {

   and on like this for each option item in the array.

This would get very long with a lot of selections.

How much of the cart is going to use this type of input?
How many size selection are going to be submitted at one time?

I have a two ideas one deals with the multiple add to cart for which I will have to see how that is setup in the cart.

John

Last edited by dh783 (06-06-2007 14:08:15)

Offline

 

#5 06-06-2007 14:35:24

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

dh783 wrote:

What you would have  to do with what you have in an if statement like:

Code:

if ($optdisp['Small'] > 0) {

     $cartdata['quantity'] = $optdisp['Small'];

} else if ($optdisp['Medium'] > 0) {

   $cartdata['quantity'] = $optdisp['Medium'];

} else if ($optdisp['Large'] > 0) {

   and on like this for each option item in the array.

I was afraid it might look like that. Maybe that's not a bad thing.

How much of the cart is going to use this type of input?

All the products will use this same type of input. The only variation will be that some will use all sizes i.e. small,medium,large,x-large,xx-large,youthsmall,youthmedium,youthlarge. Others will only use adult sizes and still others will only use adult, youthmedium and youthlarge.

How many size selection are going to be submitted at one time?

They could potentially make a selection for each size, unlikely, but possible. So, the greatest number of entries would be 8, the fewest, 1.

This is what the size options look like in the array, as I posted before:
[optdisp] => Array ( [Small] => 0 [Medium] => 0 [Large] => 2 [X-Large] => 0 [XX-Large] => 0 [Youth Small (6-8)] => 0 [Youth Medium (10-12)] => 0 [Youth Large (14-16)]

This is what the option select ids look like: [optselids] => small.0, medium.0, large.2, xlarge.0, xxlarge.0, youthsmall.0, youthmedium.0, youthlarge.0

I'll play around with what you posted and see if I can get anywhere.

John

Offline

 

#6 06-06-2007 19:42:47

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

Where are you tring to place this code?

John

Offline

 

#7 06-07-2007 00:06:45

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

I have been doing some thinking about your problem, it's not quite complete but if you go to wwwslpdoghousemusic.com and search for shirt you will see four products show up. Click on the link for the product detail for Tee Shirt (the others are just single items) and you will see what I have. If you think this type of input will work for you let me know.

This was done with very little code changes to the base code so far. The problems I haven't worked out yet is there are four items in the product database and the all show up in a search and some minor header name changes.

John

Offline

 

#8 06-07-2007 09:44:30

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

dh783 wrote:

Where are you tring to place this code?

I was trying it in cartdisplay.php, was that your intent? I've since been trying a different method that is not yet working.

dh783 wrote:

I have been doing some thinking about your problem, it's not quite complete but if you go to wwwslpdoghousemusic.com and search for shirt you will see four products show up. Click on the link for the product detail for Tee Shirt (the others are just single items) and you will see what I have. If you think this type of input will work for you let me know.

This was done with very little code changes to the base code so far. The problems I haven't worked out yet is there are four items in the product database and the all show up in a search and some minor header name changes.

That looks interesting. We don't use the related products feature so that could be hacked. It looks like you would have to create a product entry of the same shirt for each size, though. That could get confusing, unless there's a way to make them hidden. I appreciate you efforts on this, please keep me posted on this if you come up with a way to do it.

I was trying to do something where the script would take the size vales from the array and add them together. Then that value could be picked up by $cartdata('quantity'). Sorta like this:

Code:

$cartdata['quantity'] = (($cart['Small']) + ($cart['Medium']) + ($cart['Large']) + ($cart['X-Large']) + ($cart['XX-Large']));

Not sure if that's written right. Didn't work as planned. Maybe cartdisplay.php is not the place to be doing this. Usually I can get a handle on how this system works, but this issue has me pretty confused.

John

Offline

 

#9 06-07-2007 10:49:17

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

One problem I couldn't figer out about geting the quantity form the option is that once in the cart you would not have a way to change the quantity of one size over another.

I have been playing with what I posted earlyer and have fixed the problem with all items showing up in a search for shirt. I haven't had time to check this under all varaibles for an item display but it doesn't show anything but the main shirt item, take another look and see if this will work.

John

The item id are 100sm,100lg,100md,100xlg

Last edited by dh783 (06-07-2007 10:50:21)

Offline

 

#10 06-07-2007 11:16:53

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

dh783 wrote:

One problem I couldn't figer out about geting the quantity form the option is that once in the cart you would not have a way to change the quantity of one size over another.

I have been playing with what I posted earlyer and have fixed the problem with all items showing up in a search for shirt. I haven't had time to check this under all varaibles for an item display but it doesn't show anything but the main shirt item, take another look and see if this will work.

The item id are 100sm,100lg,100md,100xlg

I didn't see anything there other than 'Tee Shirt', no size selections, John. I tried searching for those ids and nothing came up. Was it supposed to show up here?

Offline

 

#11 06-07-2007 11:21:06

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

If you just tried I was playing with it, I will leave it alone so try again.

I gave the item number so you could see that they where not search able.

John

Offline

 

#12 06-07-2007 12:22:29

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

Like I said I hadn't check it under all conditions. I am seeing it because I am loged in as a supperuser, it still is not displaying for users ( or not loged in users). I will try something else.

John

Last edited by dh783 (06-07-2007 12:41:46)

Offline

 

#13 06-07-2007 12:50:07

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

Ok you can try again if you want, I have got it working like when I was loged in but I am not to happy how it being limited right now.

John

Offline

 

#14 06-07-2007 13:17:11

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

Looks good. So, the idea is that I shouldn't be able to search for those ids, right? That's how it's working now. If I search for them nothing comes up, but if I search for 'tee shirt' that does come up with the 4 quantity boxes and items. This might be pushing it, but what if you could get rid of the second column and just have the quantity fields with the words Small, Medium, Large, etc. printed above their respective quantity field? Then do that in two columns. There are going to be 8 sizes for some shirts so that list could get pretty long otherwise.

How are you getting multiple quantity fields anyhow? That's pretty slick wink

John

Offline

 

#15 06-07-2007 13:27:46

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

Yes.
The main tee shirt item is marked to be seen by all while the sizes or marked to not be seen by anybody.

What is being displaid now is jut the defualt multi add display which is contorled by the include prodmulti.php which can be made to just show what you want.

John

Offline

 

#16 06-07-2007 13:52:52

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

dh783 wrote:

Yes.
The main tee shirt item is marked to be seen by all while the sizes or marked to not be seen by anybody.

What is being displaid now is jut the defualt multi add display which is contorled by the include prodmulti.php which can be made to just show what you want.

I see. This might work for us. Did you actually modify the script or is this all just done by inserting new products as sizes and selecting 'not viewable by anyone' in the Product Visibility Selection? I could do this and then just set the product display to print two columns (which is what I have now), right?. The only problem then would be the 'related items' header, which could be changed CCP includes under Product Multi-Add Display with this code:

Code:

$header   = $this->globals('ecom.prod_store_header');

if (empty($header)) {

     if ($ns == 'prodshow') {$header = 'Related Items';} else {$header = 'Items';}

This might be a solution. I'll have to run some test.

John

Offline

 

#17 06-07-2007 14:21:20

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

What I have done so far is in private/apps/ccp0/CCP_Prod and in CCP_Prod.php funtion: prodlist look for ( be careful and make backup to be safe):

Code:

// +--
// | Handle visibility.
// +--

if (empty($usergroup)) {

     if (!(empty($where))) {$where .= 'AND ';}
     $where .= '(prodview=' . $this->KHXC_DB->quote('A') . ') ';

} else {

     if (!(empty($where))) {$where .= 'AND ';}

     $where .= '((prodview=' . $this->KHXC_DB->quote('A') . ') OR ';
     $where .= '(prodview=' . $this->KHXC_DB->quote('L') . ' AND ';

     $where .= '(prodviewg LIKE ' . $this->KHXC_DB->quote_like($usergroup . ',') . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(','  . $usergroup) . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(', ' . $usergroup) . ' OR ';
     $where .= 'prodviewg='       . $this->KHXC_DB->quote($usergroup) . '))) ';

} // End of if statement.

this I changed to get the none viewed items to show on the product page. I am not happy useing prodshow as the triger for the if statement but as of yet I haven't found another way. Change this to (I have  also not tested this on all parts of the site, but so far I have not seen any side affects):

Code:

if (empty($usergroup)) {

if ($ns == 'prodshow') {

     if (!(empty($where))) {$where .= 'AND ';}

     $where .= '((prodview=' . $this->KHXC_DB->quote('A') . ') OR ';
     $where .= '(prodview=' . $this->KHXC_DB->quote('L') . ' AND ';
     $where .= '(prodviewg LIKE ' . $this->KHXC_DB->quote_like($usergroup . ',') . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(','  . $usergroup) . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(', ' . $usergroup) . ' OR ';
     $where .= 'prodviewg='       . $this->KHXC_DB->quote($usergroup) . '))' . ' OR ';
     $where .= '(prodview=' . $this->KHXC_DB->quote('N') . ' AND ';
     $where .= '(prodviewg LIKE ' . $this->KHXC_DB->quote_like($usergroup . ',') . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(','  . $usergroup) . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(', ' . $usergroup) . ' OR ';
     $where .= 'prodviewg='       . $this->KHXC_DB->quote($usergroup) . '))) ';

} // End of if statement.

if ($ns != 'prodshow') {

     if (!(empty($where))) {$where .= 'AND ';}
     $where .= '(prodview=' . $this->KHXC_DB->quote('A') . ') ';

} // End of if statement.

} else {

     if (!(empty($where))) {$where .= 'AND ';}

if ($ns == 'prodshow') {

     $where .= '((prodview=' . $this->KHXC_DB->quote('A') . ') OR ';
     $where .= '(prodview=' . $this->KHXC_DB->quote('N') . ' AND ';

     $where .= '(prodviewg LIKE ' . $this->KHXC_DB->quote_like($usergroup . ',') . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(','  . $usergroup) . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(', ' . $usergroup) . ' OR ';
     $where .= 'prodviewg='       . $this->KHXC_DB->quote($usergroup) . '))' . ' OR ';
     $where .= '(prodview=' . $this->KHXC_DB->quote('L') . ' AND ';


} // End of if statement.

if ($ns != 'prodshow') {

     $where .= '((prodview=' . $this->KHXC_DB->quote('A') . ') OR ';
     $where .= '(prodview=' . $this->KHXC_DB->quote('L') . ' AND ';

} // End of if statement.

     $where .= '(prodviewg LIKE ' . $this->KHXC_DB->quote_like($usergroup . ',') . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(','  . $usergroup) . ' OR ';
     $where .= 'prodviewg LIKE '  . $this->KHXC_DB->quote_like(', ' . $usergroup) . ' OR ';
     $where .= 'prodviewg='       . $this->KHXC_DB->quote($usergroup) . '))) ';

} // End of if statement.

Then in Function: proshowopt at the bottom of the function look for:

Code:

// +--
// | Push the quantity field back onto the form.
// +--

$def_form['fields'][] = $quan_field;

// +--
// | Work with KHXC_Form to print the form.
// +--

$spec_form = $this->KHXC_Form->spec_form($def_form);

$result    = $this->KHXC_Form->print_form($spec_form);

if ($this->debug) {$this->debugger("prodshowopt: Printed the product options form.");}

I changed to (this gets rid of the form created for the main item as not to confuse anybody and to keep someone from adding the main item to the cart) :

Code:

// +--
// | Push the quantity field back onto the form.
// +--

if (empty($product['prodmulti'])) {

$def_form['fields'][] = $quan_field;

// +--
// | Work with KHXC_Form to print the form.
// +--

$spec_form = $this->KHXC_Form->spec_form($def_form);

$result    = $this->KHXC_Form->print_form($spec_form);

} // End of if statement.

if ($this->debug) {$this->debugger("prodshowopt: Printed the product options form.");}

I used prodmulti as the if triger but you could add another column to the product database table and use it just as easy and it would not affect the standard product multi add display.
I have not went into the include prodmulti.php and made any changes yet but I don't think that it would be to hard.

John

Last edited by dh783 (06-07-2007 14:24:30)

Offline

 

#18 06-07-2007 16:38:06

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

Thanks, John. Something I'm doing is not working. Let me double check this.

OK, so I have made the changes you specified in CCP_Prod.php, I set up some products as sizes and set them all to ''not viewable by anyone'. I related them to an existing product under 'related products'.  I changed the 'Related Product Multi-Add Indicator' settting to 'true'. Did I miss any steps?

BTW, I just saw your latest version and that looks better.

John

Offline

 

#19 06-07-2007 16:55:54

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

In the Item you want to use as the master set the Related Product Multi-Add Indicator to true and then place the id's of the items you made for the sizes in the master items Related Products field.

The items you created for the sizes will be made as a standard item, they don't need any item placed in there related products field, although I am not sure how that would affect they display and the would have the Related Product Multi-Add Indicator set a false.

Sorry that I didn't post that.

John

Last edited by dh783 (06-08-2007 09:12:50)

Offline

 

#20 06-08-2007 09:35:07

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

It wasn't till early this morining that I realized that I left out that the products you creat for your sizes will also be controled by there Product Visibility Groups field so you will need to make the apporiate selection there.

Sorry.

I was also thinking that you might want to create another column in the products database as a title for your size items so you could just put small, medium ect.. for the display in product detail and keep a more discreptive entry in the standard Display Name so when the items end up in the cart the customer could tell the items appart from other items in ther carts.

John

Offline

 

#21 06-08-2007 10:43:31

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

dh783 wrote:

It wasn't till early this morining that I realized that I left out that the products you creat for your sizes will also be controled by there Product Visibility Groups field so you will need to make the apporiate selection there.

Sorry.

I was also thinking that you might want to create another column in the products database as a title for your size items so you could just put small, medium ect.. for the display in product detail and keep a more discreptive entry in the standard Display Name so when the items end up in the cart the customer could tell the items appart from other items in ther carts.

I appreciate your efforts on this, John, but no combination of settings I try does anything at all.

I'm going to bag it for now as I have other responsibilities that need tending. Maybe I will just submit this to Nick for a quote, now that I've wasted an entire week on it.

Thanks, again. I'm not giving up, I just need a break from this to do other things, like designing t-shirts, which is what I actually do. I've been messing with this cart for months now and quite frankly I'm going blind and need a long vacation wink

John

Offline

 

#22 06-08-2007 13:42:52

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

With what you posted about not getting any results I did a little playing with the selections in Product Visibility Groups for a size items (large tee shirts or item id 100lg in my case), and it seems that any two item selected in this field (superuser, user as an example) will let the sizes be displayed for none loged in user. If there is only one group selected it will not let the item be displayed when the main item is selected for none loged in users. With no groups selected in this field the item show up for none loged in users but once loged in they are not visiable. With only one selection in this field the item only show up when loged in as that group or when loged in only the groups allowed will see the items.

Just to recap on the items in the data base they are setup llke:

Main item for display

Tee Shirt

Related Product Multi-Add Indicator set to - true
Related Products field has - 100sm,100md,100lg,100xlg (my test item ids for shirt szes)
Product Visibility Selection* - Everyone

all other fields setup as for a normal item for sale


Shirt size item

100lg
all fields setup as for a normal item for sale execpt

Product Visibility Selection* - Not Viewable By Anyone
Product Visibility Groups - supperuser,user (at least two to get it to show for none loged in users)

It's kinda of  a strange reaction on the visiablity part but that's what I am getting.

Has for the code that I posted it is a direct copy of what was running at the time so hopfully that is not causeing you any problems.

John

Last edited by dh783 (06-08-2007 13:44:35)

Offline

 

#23 06-14-2007 13:47:29

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

dh783 wrote:

With what you posted about not getting any results I did a little playing with the selections in Product Visibility Groups for a size items (large tee shirts or item id 100lg in my case), and it seems that any two item selected in this field (superuser, user as an example) will let the sizes be displayed for none loged in user. If there is only one group selected it will not let the item be displayed when the main item is selected for none loged in users. With no groups selected in this field the item show up for none loged in users but once loged in they are not visiable. With only one selection in this field the item only show up when loged in as that group or when loged in only the groups allowed will see the items.

Hi John,

I was looking at your T-shirts pages and tried entering an item. It works well except what about the links in the cart? They are active and when clicked don't lead anywhere. For us that would be a problem.

I posted another script that almost works for my original method. I'm taking another swipe at this.

Thanks, again for your time on this.

John

Offline

 

#24 06-14-2007 16:11:59

dh783
Moderator
From: Avondale, Arizona
Registered: 04-06-2005
Posts: 6233
Website

Re: Update cart quantity from product display.

The cart link problem is a side effect of the item not being viewable. I have made a way that the item points back to the main item from which is was posted from.

John

Offline

 

#25 06-19-2007 11:34:06

JGB
Member
From: Holyoke, Massachusetts
Registered: 01-16-2004
Posts: 298

Re: Update cart quantity from product display.

Nick pointed out that I had my  'Product Page: Display Related Products' set to false. That's why nothing was showing up when I tried this. Hate when that happens...

Offline

 

Board footer