[+] BO: Add a wizard to create and edit your carriers

This commit is contained in:
Rémi Gaillard
2013-07-26 18:27:21 +02:00
parent 42c5335f27
commit c0cf92cbdf
34 changed files with 2589 additions and 233 deletions

View File

@@ -156,33 +156,16 @@ class AdminCarriersControllerCore extends AdminController
parent::__construct();
}
public function initToolbar()
{
parent::initToolbar();
if (isset($this->toolbar_btn['new']))
$this->toolbar_btn['new']['href'] = $this->context->link->getAdminLink('AdminCarrierWizard');
}
public function renderList()
{
$this->displayInformation(
'&nbsp;<b>'.$this->l('How do I create a new carrier?').'</b>
<br />
<ul>
<li>'.$this->l('Click "Add New."').'<br /></li>
<li>'.$this->l('Fill in the fields and click "Save."').'</li>
<li>'.
$this->l('You need to set a price range -- or weight range -- for which the new carrier will be available.').' '.
$this->l('Under the "Shipping" menu, click either "Price ranges" or "Weight ranges.".').'
</li>
<li>'.$this->l('Click "Add New."').'</li>
<li>'.
$this->l('Select the name of the carrier before defining the price or weight range.').' '.
$this->l('For example, the carrier can be made available for a weight range between 0 and 5lbs. Another carrier can have a range between 5 and 10lbs.').'
</li>
<li>'.$this->l('When you\'re done, click "Save."').'</li>
<li>'.$this->l('Click on the "Shipping" menu.').'</li>
<li>'.
$this->l('You need to set the fees that will be applied for this carrier.').' '.
$this->l('At the bottom on the page -- in the "Fees" section -- select the name of the carrier.').'
</li>
<li>'.$this->l('For each zone, enter a price and then click "Save."').'</li>
<li>'.$this->l('You\'re all set! The new carrier will now be displayed to customers.').'</li>
</ul>'
);
$this->_select = 'b.*';
$this->_join = 'LEFT JOIN `'._DB_PREFIX_.'carrier_lang` b ON a.id_carrier = b.id_carrier'.Shop::addSqlRestrictionOnLang('b').'
LEFT JOIN `'._DB_PREFIX_.'carrier_tax_rules_group_shop` ctrgs ON (a.`id_carrier` = ctrgs.`id_carrier`
@@ -696,6 +679,11 @@ class AdminCarriersControllerCore extends AdminController
}
}
public function displayEditLink($token = null, $id, $name = null)
{
return '<a href="'.$this->context->link->getAdminLink('AdminCarrierWizard').'&id_carrier='.(int)$id.'"><img src="../img/admin/edit.gif"/></a>';
}
}