Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

//fixed small bug when added new Shop URL

  • Loading branch information...
commit 585a049d165ca75a5e960626b576b4d5667d179c 1 parent 2011cdb
@vAugagneur vAugagneur authored
View
3  classes/shop/ShopUrl.php
@@ -124,10 +124,11 @@ public function setMain()
public function canAddThisUrl($domain, $domain_ssl, $physical_uri, $virtual_uri)
{
$physical_uri = trim($physical_uri, '/');
+
if ($physical_uri)
$physical_uri = preg_replace('#/+#', '/', '/'.$physical_uri.'/');
else
- $this->physical_uri = '/';
+ $physical_uri = '/';
$virtual_uri = trim($virtual_uri, '/');
if ($virtual_uri)
View
4 controllers/admin/AdminShopUrlController.php
@@ -360,6 +360,10 @@ public function processSave()
public function processAdd()
{
$object = $this->loadObject(true);
+
+ if ($object->canAddThisUrl(Tools::getValue('domain'), Tools::getValue('domain_ssl'), Tools::getValue('physical_uri'), Tools::getValue('virtual_uri')))
+ $this->errors[] = Tools::displayError('A shop URL that use this domain and uri already exists');
+
if ($object->id && Tools::getValue('main'))
$object->setMain();
Please sign in to comment.
Something went wrong with that request. Please try again.