Jump to content

Archived

This topic is now archived and is closed to further replies.

djms

Must Select Attribute

Recommended Posts

I've installed the Must Select Attributes by OceanRanch found in Carine Bruyndoncx's contribution by the same name and am now getting the following error message when I try to add something to my cart whether I've selected from the attributes list or not.

 

Fatal error: Call to a member function on a non-object in /home/abc/mycompanyname-www/catalog/includes/application_top.php on line 388

 

Line 388 is the third line in the following piece of code...$messageStack->reset();

 

/BoF CB Enforce attribute selection

if (is_array($HTTP_POST_VARS['id']) ) {

$messageStack->reset();

 

while (list($option, $value) = each($HTTP_POST_VARS['id'])) {

 

// 36 is the value for "-select-"

//if ($value == 36) {

if (($value == 36) or ($value == 36) or ($value == 36) ) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_GET_VARS['products_id'] . '&mustselect=product_info'));

break;

}

}

} elseif (tep_has_product_attributes($HTTP_POST_VARS['products_id'])) {

tep_redirect(tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $HTTP_POST_VARS['products_id']));

break;

}

//EoF CB

 

Also I have multiple attributes so I have commented out the single if($value==36){ and used the multiple if (($value==36) statement as above. Does anyone know if I'm supposed to have 36 in each of the ($value== 36) areas on this line? It originally had ($value == 9) or ($value == 10) or ($value == 999). The instructions said to replace the 9's with the "--please select--" attibute value in our system (mine is 36). Should I replace the 10 and 999 as well?

 

Any ideas to solve these issues? Please be very specific as I don't know php and am feeling my way through this setup like a blindfolded monkey in a house of knives. :'(

 

Unending thanks for any help offered,

Djms

Share this post


Link to post
Share on other sites

you can change

 $messageStack->reset();

 

with

if (is_array($messageStack)) { $messageStack->reset(); }

 

If you only have one must select value setup (36 in your case), you can just keep the previous line, and comment out the line with the or statements.

 

HTH,

Carine


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

That did it! It works like a charm now.

 

A thousand thanks,

Djms

Share this post


Link to post
Share on other sites

thank you guys :)

it is nice to get a pat on the back once a while :D


KEEP CALM AND CARRY ON

I do not use the responsive bootstrap version since i coded my responsive version earlier, but i have bought every 28d of code package to support burts effort and keep this forum alive (albeit more like on life support).

So if you are still here ? What are you waiting for ?!

 

Find the most frequent unique errors to fix:

grep "PHP" php_error_log.txt | sed "s/^.* PHP/PHP/g" |grep "line" |sort | uniq -c | sort -r > counterrors.txt

Share this post


Link to post
Share on other sites

×