Jump to content

televi

Members
  • Posts

    12
  • Joined

  • Last visited

1 Follower

Profile Information

  • First Name
    Tele
  • Last Name
    Vi

televi's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. I want to create a new link/page in the backoffice left side menu. So i figuered i will create a controller. controllers/admin/AdminPageController.php <?php class AdminPageController extends AdminController { public function initContent() { parent::initContent(); $smarty = $this->context->smarty; $smarty->assign('testpage', 'testpage'); } } ?> admin\themes\default\template\controllers\page\content.tpl $con=mysqli_connect("localhost","root","password","prestashop"); // Check connection if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM ps_customer"); echo "<table border='1'> <tr> <th>company</th> <th>email</th> </tr>"; while($row = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td>" . $row['company'] . "</td>"; echo "<td>" . $row['email'] . "</td>"; echo "</tr>"; } echo "</table>"; mysqli_close($con); ?> At BackOffice -> Administration -> Menus -> i created the menu to my controller with Home as parent. according to this, it should show the company & email column from the ps_customer table. However, when i open that test page, i see this: company email "; while($row = mysqli_fetch_array($result)) { echo ""; echo "" . $row['company'] . ""; echo "" . $row['email'] . ""; echo ""; } echo ""; mysqli_close($con); ?> How come it's not display the table? what am i doing wrong? Thanx
  2. I am still stuck on this.. i tried looking at the osname but i do not really undestand what am i missing.. can somebody help me out?
  3. Hello, We created a column in our ps_product table called province. And inside that column we have listed provinces for each product Ontario, Quebec etc.. Now in Backoffice, when we are viewing all products we would like to have a drop down menu that where we can select each province.. In AdminProductsController.php we have: $this->fields_list['province'] = array( 'title' => $this->l('Test'), 'filter_key' => 'a!province', 'align' => 'text-center', 'type' => 'select', 'class' => 'chosen', 'orderby' => false, ); If you look at my screen shot the drop down menu (blue) is empty. How do we fill it up with our options, or can it pull the options from the province colum in the ps_product table? Thank you!
  4. Did anyone find a solution for 1.6.1.17? I tried adding that code to override/classes/tax/TaxCalculator.php and it does NOT work for me. override/classes/tax/TaxCalculator.php reads: <?php class TaxCalculator extends TaxCalculatorCore { public function getTaxesTotalAmount($price_te) { $amount = 0; $taxes = $this->getTaxesAmount($price_te); foreach ($taxes as $tax) $amount += $tax; $context = Context::getContext(); if($context->customer->id_default_group == 46 ) // 17 is the UserGroup whith no tax return 0; else return $amount; } } Am I missing anything? Do i need any other code to change in any of the other PHP files?
  5. I have attached a screenshot of an employee logged in and viewing an order. They do NOT see the Shipping tab. But when i login as a Super Admin and view an order i do see the shipping tab. I can even enter a tracking number. My second screen shot is showing that the employee has every single permission possible and he still does not see the shipping tab when viewing an order. Why is this happening? What do i have to do in order to show the shipping tab to my employees? For security reasons i do not want to give SuperAdmin to my employees.
  6. My employees are set with the default permissiona for the Salesmen profile. I created a new profile and selected every single permission possible to test it out and I still could not see the shipping info when I login as an employee user.
  7. My SuperAdmin can add/change/view the shipping tracking number. My Customers can view their tracking number. But how can i allow my employees to be able to View the tracking number? When an employee logs in and view the order they do not have the "Shipping | Merchandise " tab table. I gave every single permission to my employees but they still do not see the shipping box. What do i have to do in order to allow my employees to View the shipping tab? Thank you!
  8. In backoffice, when an employee creates an order i would like to hide the "Carts" tab and only show the Orders tab. Or if its easier maybe make the Orders tab as the default tab instead of the Carts tab (my attachment shows which part i am talking about) I tried editing the myadmin/themes/default/template/controllers/orders/form.tpl but i cant figure it out
  9. Hello everyone, I was wondering if i can assign employees to specifict product categories? When an employee is creating an order for a customer, I want that employee to ONLY search for products in a specific category that the employee has access to. I was able to create customers assigned to specific product categories but i cannot seem to assign employees to specific product categories. For example right now, if a customer is assigned to product category "tshirts" that customer only sees tshirts, but if an employee tries to create an order for that customer they see "tshirts" "pants" "jeans" etc... i want them to only see the customers assigned category. is this possible to do with prestashop? What i tried doing is adding a column in ps_employee called id_default_group and assigned the appropriote group id that i want the user to access. But i am sure i need some php code so that the employee can only search products in that group while create an order for that customer. Alternatively, in the employee portal - Orders - add new order - the "Search for Products" bar should search for products only related to the previously specified customer and NOT for all products. It makes no sense for it to search for all products when that customer has no access to those products. Thank you
  10. Yes but that rounds it up to 0.61 where as I want it to be rounded to 0.62
  11. Hello Everyone, In excel, i have =ROUNDUP(cell,2) which rounds up the number differently than prestashop, example: if in the cell i have 0.6108838 will equal to 0.62... where as in prestashop it shows up as 0.61 how can i fix this issue? what do i have to do to roundup the same way that excel does it? I also came across this: Excel-like ROUNDUP function: public static function round_up($value, $places) { $mult = pow(10, abs($places)); return $places < 0 ? ceil($value / $mult) * $mult : ceil($value * $mult) / $mult; } echo round_up(12345.23, 1); // 12345.3 echo round_up(12345.23, 0); // 12346 echo round_up(12345.23, -1); // 12350 echo round_up(12345.23, -2); // 12400 echo round_up(12345.23, -3); // 13000 echo round_up(12345.23, -4); // 20000 but how can i implemennt this in prestashop ? Thannk you so much
×
×
  • Create New...