-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Lurivar/master
Fix issue when choosing relay and not connected in admin
- Loading branch information
Showing
4 changed files
with
39 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
|
||
namespace ChronopostPickupPoint\Controller; | ||
|
||
|
||
use ChronopostPickupPoint\Model\ChronopostPickupPointOrderAddress; | ||
use Thelia\Controller\Front\BaseFrontController; | ||
use Thelia\Model\CountryQuery; | ||
|
||
class ChronopostPickupPointFrontController extends BaseFrontController | ||
{ | ||
/** | ||
* @return \Thelia\Core\HttpFoundation\Response | ||
* @throws \Propel\Runtime\Exception\PropelException | ||
*/ | ||
public function saveAddressAction() | ||
{ | ||
$addr = new ChronopostPickupPointOrderAddress(); | ||
$countryId = CountryQuery::create()->filterByIsoalpha2($this->getRequest()->get('country'))->findOne()->getId(); | ||
|
||
$addr | ||
->setCompany($this->getRequest()->get('company')) | ||
->setAddress1($this->getRequest()->get('addr1')) | ||
->setAddress2($this->getRequest()->get('addr2')) | ||
->setAddress3($this->getRequest()->get('addr3')) | ||
->setCountryId($countryId) | ||
->setZipCode($this->getRequest()->get('zip')) | ||
->setCity($this->getRequest()->get('city')) | ||
->save() | ||
; | ||
|
||
$this->getRequest()->getSession()->set('ChronopostPickupPointId', $addr->getId()); | ||
|
||
return $this->jsonResponse($addr->getId(), 200); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters