From: Konrad Rosenbaum Date: Tue, 20 Mar 2012 18:08:58 +0000 (+0100) Subject: add default address for online shopping X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=3d132ff4760fdbf68db9b0d1d9ce7f95b8a90f74;p=web%2Fkonrad%2Fsmoke.git add default address for online shopping --- diff --git a/www/inc/wext/customer.php b/www/inc/wext/customer.php index cfe08f8..c411c61 100644 --- a/www/inc/wext/customer.php +++ b/www/inc/wext/customer.php @@ -484,14 +484,24 @@ class WOCustomer extends WOCustomerAbstract } //store in cart if($storeincart){ + //get cart $cartid=WebCart::getCart(); if($cartid==""){ $p=$twig->loadTemplate("carterror.html"); return $p->render($basevars); } + //get customer data $cart=WTcart::getFromDB($cartid); $cart->customerid=$ct->customerid; $cart->update(); + //get address if there is none yet + if($cart->deliveryaddress==false){ + $addrs=WTaddress::selectFromDB("customerid=".$ct->customerid,"ORDER BY lastused DESC"); + if(count($addrs)>0){ + $cart->deliveryaddress=$addrs[0]->addressid; + $cart->update(); + } + } } //store in session $sess=WOWebSession::getOrCreateWebSession(); diff --git a/www/template/en/index.html b/www/template/en/index.html index 95a058f..12ed001 100644 --- a/www/template/en/index.html +++ b/www/template/en/index.html @@ -14,7 +14,7 @@
  • Ticket Shop
  • Voucher Shop
  • Merchandising
  • -
  • My Shoping Cart
  • +
  • My Shopping Cart
  • {% endblock page %}