Zen Cart Logo
If this is your first visit, check our documentation. To post, register or login.
Forums / Customizing the Look of Your Shop / Templates, Stylesheets, Page Layout / forcing one product record to appear as two in shopping cart page

forcing one product record to appear as two in shopping cart page

Started by cem1 on 22 May 2011, 2:40 PM · Views: 525

Results 1 to 2 of 2
22 May 2011, 2:40 PM
#1
cem1 avatar

cem1

New Zenner

Join Date:
May 2011
Posts:
17
Plugin Contributions:
0

Post #1 by cem1

Hello,
there is a website that sells products like (marble, granite, stone, mosaics, etc.) where the buyer can select to either request a sample of the product or buy the product itself. This can be seen in the following url: http://joomji.com/usamarblesite/index.php?main_page=index&cPath=2. The page is referencing the same product but splitting it up to make it seem like it is two products with the use of two buttons, buy now and sample request. The sample request button is overriding the Weight field in the listing_product.php as weight is not needed. When a user clicks on sample request he/she is taken to the shopping cart page for a sample request. If the user clicks back and selects buy now button he gets the product without the words 'sample request'. In a simplified scenario this would work fine, but what if the user wants to add an entirely new product to the cart? If that happens, the cart would show the new product selected and a sample request version of the product selected even if the user wanted a sample request only and not the product or vice versa. This is happening because I am using conditional statement blocks in the shopping cart page to display show product only , show sample request only or both depending on whether 'buy now' or 'sample request' buttons, or both where selected by the user in the product listing page. The conditional statement blocks are checking $_SESSION variables, one for sample request and the other for product only that I set at the top of the shopping_cart page to determine if it is a sample request or a product only that the user wants based on the button pushed. Because the $_SESSION is always set once it is defined, the conditional statement will always be true and show the block that displays sample request even if the user did not click the sample request button. Is there a simpler way of achieving what I'm trying to accomplish? Thanks, Charles :blink:

23 May 2011, 12:52 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Post #2 by kobra

Owing to the number of views and no responses

I think none of us has a clear picture of what it is you are seeking
What you have already hacked
Like what file & path
What code alteration

Adding additional clarification specifics might yield some responses

Zen-Venom Get Bitten