close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Delete one item of the cart passing ID to a php page

Thread began 7/20/2016 2:01 pm by Xavia Digital | Last modified 7/21/2016 1:36 pm by Ray Borduin | 81 views | 3 replies |

Xavia Digital

Delete one item of the cart passing ID to a php page

Hi,

I need to delete on item of the cart. I tryed the "remove Link" option but it does not work.

My idea is to pass the ID od the element of the cart to a php page that roam the cart and when the id equald detele the item.
I tryed with the DeleteFormCart() method that i have seem in the object but it does not work.

Any sugestions?

Thanks!

Sign in to reply to this post

Ray BorduinWebAssist

You would have to loop through the cart to find the item you wanted to delete and then delete it... this function would do the trick:

function DeleteByID($cart,$id) {
for ($n=0; $n<sizeof($cart->Items); $n++) {
if ($cart->Items[$n]) {
if ($cart->Items[$n]->ID == $id) {
$cart->Items[$index] = null;
$cart->ReIndexContent();
$cart->ResetAll();
$cart->SaveCart();
}
}
}
}
Sign in to reply to this post

Xavia Digital

RE.

Thanks Ray!!

It is posible to do the same to update one item passing the id?

Thanks for the support. Congratulations on some extensions like "Framework builder" who now have become indispensable for us and have no alternative in the market. I hope we will soon have news about you :)

Sign in to reply to this post

Ray BorduinWebAssist

Yes. For example to update a quantity you could use something like:

php:
function UpdateQuantityByID($cart,$id,$qty) {

    for ($n=0; $n<sizeof($cart->Items); $n++)      {
      if ($cart->Items[$n])     {
        if ($cart->Items[$n]->ID == $id)     {
          $cart->Items[$n]->Quantity = $qty;
          $cart->SaveCart();
        }
      }
    }
}
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...