Jump to content

Tje123

Members
  • Posts

    17
  • Joined

  • Last visited

Profile Information

  • First Name
    yasiru
  • Last Name
    Attanayake

Recent Profile Visitors

316 profile views

Tje123's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I have developed a custom module and install it from back office.lately i got a requirement to change the module name. I tried these steps. Rename my module folder name (my_shipping -> shipping_module ) Rename module file under modules folder (my_shipping.php -> shipping_module) Rename class name and name class Shipping_module extends CarrierModule { protected $config_form = false; public function __construct() { $this->name = 'shipping_module'; $this->tab = 'shipping_logistics'; $this->version = '1.0.0'; $this->author = 'DDD'; $this->need_instance = 0; } } Then i have refresh my back office module selection and i saw it under `installed modules` tab.(but i've started these steps when uninstall it).then i tried to uninstall it .then it show me How to rename my existing custom module?
  2. Dashboard stats `shop search` records not showing.it's showing message `Cannot find any keywords that have been searched for more than once.`
  3. hi, i would like to use drop down list instead of textbox for 'CIty' field (like 'country list').but i don't know which .tpl/Controller i want to edit. I would really appreciate all the help i can get . address
  4. In customer address form `city` field showing text field (Front end).i want to change that textfield in to Dropdown list.how can i change it?
  5. Im developing carrier module.in my backoffice i have bool value. in my field list like below public function renderList() { $this->addRowAction('edit'); $this->addRowAction('delete'); $this->bulk_actions = [ 'delete' => [ 'text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?') ] ]; $this->fields_list = [ 'availability' => [ 'title' => $this->l('Availability'), 'width' => 90, 'active' => 'Availability', 'type' => 'bool', 'orderby' => FALSE ], ] in my class i have define it like below public $availability=true; when i click on the `red cross` it's not updating.
  6. in my back office controller renderForm i have drop down list to load week days.but it showing only first letter of the day. public function renderForm() { $days=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]; 'input' => [ [ 'type' => 'select', 'lang' => true, 'required' => true, 'label' => $this->l('WeekDay'), 'name' => 'weekday', 'options' => [ 'query' => $days, ], ], ] }
  7. i'm developing carrier module for my project.i have to update a new column after checkout. inside my module ,i want to call some hook immediately after order placed to get `order id` . i have used below hooks.but no luck. public function hookActionOrderStatusUpdate($params){ $order_id=$params['newOrderStatus']->id; } public function hookActionOrderStatusPostUpdate($params){ $order_id=$params['newOrderStatus']->id; } public function hookDisplayOrderConfirmation($params){ $order_id=$params['newOrderStatus']->id; } how to get order id into my module,when user on order confirmation page?
  8. i'm developing prestashop carrier module.inside mycarrier i have two radio buttons(`now`,`schedule`) when user select `now` i,m getting current datetime.when user select schedule i'm prompt calender to pick datetime. problem : when user select one of radio button,form will submit immediately.but i want form to wait until user pick date from calendar. how can i delay my form submission? <form class="clearfix" id="js-delivery" data-url-update="{url entity='order' params=['ajax' => 1, 'action' => 'selectDeliveryOption']}" method="post" > <button type="submit" class="continue btn btn-primary pull-xs-right" name="confirmDeliveryOption" value="1"> {l s='Continue' d='Shop.Theme.Actions'} </button> </form>
  9. in my controller, i have cost value for shipping.i'm trying to send it to `getOrderShippingCost` function. but my cart showing shipping `free` **Controller.php** $cost_val=120; //this value can be change include_once(_PS_MODULE_DIR_.'delivery_scheduler/delivery_scheduler.php'); $DeliveryWeekSched=new delivery_scheduler(); $DeliveryWeekSched->getOrderShippingCost($cost_val,$cost_val); **delivery_scheduler.php** public function getOrderShippingCost($params, $shipping_cost) { if (Context::getContext()->customer->logged == true) { $id_address_delivery = Context::getContext()->cart->id_address_delivery; $address = new Address($id_address_delivery); return 100; // i want to return `$shipping_cost` } return $shipping_cost; } when return `$shipping_cost` shipping value in cart showing `free`.when `100` return cart shipping value showing `100`.why is that?how to return my value?
  10. I'm developing carrier module for my prestashop project.i have loaded week days from my db table for user to select. what i'm trying to do : when user select a day,i want to show time ranges for that day. **DeliveryWeek.php class** public function getweekday(){ $dbQuery = new DbQueryCore(); $dbQuery->select('*'); $dbQuery->from('delivery_weeks', 'c'); $result = Db::getInstance(_PS_USE_SQL_SLAVE_) ->executeS($dbQuery); return $result; } **delivery_scheduler.php** public function hookDisplayCarrierExtraContent() { global $smarty; include_once(_PS_MODULE_DIR_.'delivery_scheduler/classes/DeliveryWeek.php'); $DeliveryWeek=new DeliveryWeek(); $resul=$DeliveryWeek->getweekday(); foreach ($resul as $res) { $var[]=$res['weekday']; } $this->smarty->assign(array('WeekVal' => $resul)); return $this->display(__FILE__, 'views/templates/front/calendar.tpl'); } **calendar.tpl** <div class="block_content"> <p> {foreach $WeekVal as $item} <input type="radio" name="id_gender" id="{$item.id_zm_delivery_week}" value="{$item.weekday}" /> <label for="{$item.id_delivery_week}" class="top">{$item.weekday}</label></br> {/foreach} </p> </div> **delivery_weeks table** +---------------------+-----------+--------------+--------------+--------------------------+--------------------------+--------------------------+ | id_delivery_week | weekday | availability | default_cost | specific_time_cost_1 | specific_time_cost_2 | specific_time_cost_3 | +---------------------+-----------+--------------+--------------+--------------------------+--------------------------+--------------------------+ | 1 | Sunday | 0 | 150.00 | 06:00:00-10:00:00-100.00 | 10:00:00-18:00:00-120.00 | 18:00:00-22:00:00-150.00 | | 2 | Monday | 1 | 150.00 | 06:00:00-10:00:00-100.00 | | 18:00:00-22:00:00-150.00 | | 3 | Tuesday | 1 | 150.00 | 06:00:00-10:00:00-100.00 | | 18:00:00-22:00:00-150.00 | | 4 | Wednesday | 1 | 150.00 | 06:00:00-10:00:00-100.00 | | 18:00:00-22:00:00-150.00 | | 5 | Thursday | 1 | 150.00 | 06:00:00-10:00:00-100.00 | | 18:00:00-22:00:00-150.00 | | 6 | Friday | 1 | 150.00 | 06:00:00-10:00:00-100.00 | | 18:00:00-22:00:00-150.00 | | 7 | Saturday | 1 | 150.00 | 06:00:00-10:00:00-100.00 | 10:00:00-18:00:00-120.00 | 18:00:00-22:00:00-150.00 | +---------------------+-----------+--------------+--------------+--------------------------+--------------------------+--------------------------+
  11. I'm new to prestashop and developing new module for carrier. Calender.php class delivery_schedulercalendarModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->setTemplate('module:delivery_scheduler/views/templates/front/calendar.tpl'); } public function run() { return 'abc'; } } i want to display `abc` in calender.tpl public function hookDisplayCarrierExtraContent() { //how to call `run()` function here }
  12. i have added both displayCarrierList,displayBeforeCarrier like below.but nothing showing public function hookdisplayCarrierList() { return "Test"; } public function displayBeforeCarrier() { return "Test"; } At least i cant show "Test" message below to carrier option
  13. I'm new to prestashop and i'm trying to develop new carrier module for my prestashop project. **Requirement :** customer allow to schedule delivery (add date time). **what i want to do :-** when customer select (`Schedule delivery`), i want to display calendar to select date. **So far what i did :-** i have crated new module for carrier (`Schedule delivery` carrier in image). created .tpl file inside `views/templates/front/Carrier.tpl`. Created class file inside `Controllers/front/Carrier.php`. **Carrier.tpl** <div id="mymodule_block_home" class="block"> <h4>Welcome!</h4> <div class="block_content"> <p>Calender</p> <ul> <li><a href="{$my_module_link}" title="Click this link">Click me!</a></li> </ul> </div> </div> **Carrier.php** class delivery_schedulerCarrierModuleFrontController extends ModuleFrontController { public function initContent() { parent::initContent(); $this->setTemplate('module:delivery_scheduler/views/templates/front/Carrier.tpl'); } } in main `delivery_scheduler.php`,i have added bellow code to import .tpl file.but nothing showing . public function hookUpdateCarrier($params) { return $this->display($this->_path.'views/templates/front/Carrier.tpl'); }
  14. I have found `{$voucher.reduction_formatted}` in cart-vouture.tpl.it's showing the discount in cart.i tried to add it to `fieldtabproductsisotope.tpl` (modules/fieldtabproductsisotope/views/templates/hook/fieldtabproductsisotope.tpl) file.but it's show nothing
  15. I have added discount for special products via Admin panel (Catalog->discount->Cart rules).this discount is showing when item is on checkout. but i want to show that discount on top of the item.how can i check 'product has special discount' and display discount percentage or amount like below image?
×
×
  • Create New...