News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

How to replace cart data into url?

Started by indies.tester, May 30, 2013, 07:02:49 AM

Previous topic - Next topic

indies.tester

I am working on an abandoned cart module where there is need to replace cart data into the URL when user click on URL. I am able to get cart object into the variable and also able to fetch URL. now the thing is when user click on that URL it shows only that page from where URL is store... how do i replace cart data so that cart should also remain as it is when user click on it (i.e. if cart has two product than when user come after long time by click on URL what i send them cart also had two product in that so user has not have to add that manually again).

Code What I am Using

//To Get Cart Object
$cart = VirtueMartCart::getCart();

//To Store Cart data into database
$d=json_encode($cart);

// Function to get url
function curPageURL()
    {
         $pageURL = 'http';
         if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
         $pageURL .= "://";
         if ($_SERVER["SERVER_PORT"] != "80")
         {
         $pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
         }
         else
         {
          $pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
         }
            return $pageURL;
    }
    {
        echo curPageURL();
        exit;
    }


Now how do i replace cart object into the URL so that user has not to add product manually.

I am using

Joomla 2.5.8

Php 5.4.3

Virtuemart 2.0.14