close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Display specific line item

Thread began 4/28/2011 9:17 am by Dave Buchholz | Last modified 4/28/2011 8:57 pm by Jason Byrnes | 1971 views | 6 replies |

Dave BuchholzBeta Tester

Display specific line item

Is there a method I can access where I can define a single line item to display for modification purposes in the following general scenerio ?

My cart object is eCart1 as standard.

I have 3 products in my cart and I want to modify my order for the 2nd product, so I click on a link that sends me to another page where that product along with it's options are displayed for updating.

I am guessing I need to pass the product id and display index ($eCart1->DisplayIndex) but how do I tell the cart object to only display that line or access the individual columns from that line to prepopulate the page ?

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

if you are not using any product options, you could pass only the ID as a querystring variable to standard cart display page. And add an if statement.

So the link would look like:
ItemUpdate.php?id=2

and in the cart display code, change the while loop:

php:
<?php

while (!$eCart1->EOF())      {
?>
          <tr>
            <td  class="eC_GroupColumn"><img  src="<?php echo $eCart1->DisplayInfo("Thumbnail"); ?>" alt="Product thumbnail" class="eC_ProductThumb" />
              <p class="eC_ItemName"><?php echo $eCart1->DisplayInfo("Name"); ?></p>
              <p class="eC_ItemDescription">Description:&nbsp;<?php echo $eCart1->DisplayInfo("Description"); ?></p></td>
            <td  class="eC_PriceItem"><?php echo WA_eCart_DisplayMoney($eCart1$eCart1->DisplayInfo("Price")); ?></td>
            <td  class="eC_FormItem"><input type="text" name="eCart1_Quantity_<?php echo $eCart1->DisplayIndex?>" size="3" value="<?php echo $eCart1->DisplayInfo("Quantity"); ?>" /></td>
            <td  class="eC_FormItem"><input type="checkbox" value="<?php echo $eCart1->DisplayInfo("ID"); ?>" name="eCart1_Delete_<?php echo $eCart1->DisplayIndex?>" /></td>
            <td  class="eC_PriceItem"><?php echo WA_eCart_DisplayMoney($eCart1$eCart1->DisplayInfo("TotalPrice")); ?></td>
          </tr>
          <?php
  $eCart1
->MoveNext();
}
$eCart1->MoveFirst();
?>



add an if statement to compare the id querystring:

php:
<?php

while (!$eCart1->EOF())      {
?>
<?php 
if(isset($_GET) && $_GET['id'] == DisplayInfo("ID")) { ?>
          <tr>
            <td  class="eC_GroupColumn"><img  src="<?php echo $eCart1->DisplayInfo("Thumbnail"); ?>" alt="Product thumbnail" class="eC_ProductThumb" />
              <p class="eC_ItemName"><?php echo $eCart1->DisplayInfo("Name"); ?></p>
              <p class="eC_ItemDescription">Description:&nbsp;<?php echo $eCart1->DisplayInfo("Description"); ?></p></td>
            <td  class="eC_PriceItem"><?php echo WA_eCart_DisplayMoney($eCart1$eCart1->DisplayInfo("Price")); ?></td>
            <td  class="eC_FormItem"><input type="text" name="eCart1_Quantity_<?php echo $eCart1->DisplayIndex?>" size="3" value="<?php echo $eCart1->DisplayInfo("Quantity"); ?>" /></td>
            <td  class="eC_FormItem"><input type="checkbox" value="<?php echo $eCart1->DisplayInfo("ID"); ?>" name="eCart1_Delete_<?php echo $eCart1->DisplayIndex?>" /></td>
            <td  class="eC_PriceItem"><?php echo WA_eCart_DisplayMoney($eCart1$eCart1->DisplayInfo("TotalPrice")); ?></td>
          </tr>
<?php ?>
          <?php
  $eCart1
->MoveNext();
}
$eCart1->MoveFirst();
?>
Sign in to reply to this post

Dave BuchholzBeta Tester

The only issue with that is that a customer could have the same product with different options otherwise it would be perfect

Sign in to reply to this post

Jason ByrnesWebAssist

yeah, that's why I started off saying:
if you are not using any product options


Since you are using options, how do you want to handle the option?

Will the options be updatable?

if you want the option to be updatable, the pass the option as a quersyring variable too:

ItemUpdate.php?id=2&color=red

go to the bindings panel and click the plus button, select URL Variable an name it "option"
then in design view for the cart display, select the option column and insert an eCart editable Select list. Insert -> Webassist -> eCart -> Updatable List

in the property inspector for the list, click the dynamic button, set the static values for the list of available options, then click the lightning bolt next to Select Value Equal to and select the option querystring variable.

Sign in to reply to this post

Dave BuchholzBeta Tester

I have both select list / checkbox items and text strings that need to be updateable.

Humm I think I may need to revisit this and reconsider how I am going to go about this.

Sign in to reply to this post

Dave BuchholzBeta Tester

This seems to work for me

php:
<?php if(isset($_GET) && $_GET['index'] == ($eCart1->DisplayIndex)) { ?>
Sign in to reply to this post

Jason ByrnesWebAssist

Ok, cool, glad to hear it is working.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...