Jump to content

David Bucur

Members
  • Posts

    21
  • Joined

  • Last visited

1 Follower

Profile Information

  • Location
    Ireland
  • Activity
    Web development agency

Recent Profile Visitors

729,658 profile views

David Bucur's Achievements

Newbie

Newbie (1/14)

7

Reputation

  1. Hi Vekia, I am willing to do the modifications. Can you give me a rough idea of how should I modify it?
  2. I know there is an option in positions to remove the module from the full suppliers pages. But I just need it removed from the list of all suppliers, not from the page that shows every supplier's products. PS 1.5.6 Thanks
  3. But I guess the performance will decrease if it has to build every part of the page from scratch PD: This flush might happen once a week, not every day.
  4. Hi all, I am synchronizing a module with the main core of prestashop and I need to flush the cache in order for the changes to appear. But I want to do that automatically as the owner of the shop doesn't have enough knowledge of technologies... Is there an order like $cache->flush(); or similar? Thanks
  5. Thanks Fabien, your solution solved the problem,it was as easy as to change the parent:: to AdminController:: This is the complete solution if someone needs it. <?php class AdminSuppliersController extends AdminSuppliersControllerCore { public function renderForm() { // loads current warehouse if (!($obj = $this->loadObject(true))) return; $this->fields_form = array( 'legend' => array( 'title' => $this->l('Suppliers'), 'image' => '../img/admin/suppliers.gif' ), 'input' => array( array( 'type' => 'hidden', 'name' => 'id_address', ), array( 'type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'size' => 40, 'required' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', ), array( 'type' => 'textarea', 'label' => $this->l('Description:'), 'name' => 'description', 'size' => 60, 'rows' => 10, 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', 'desc' => $this->l('Will appear in the supplier list'), 'autoload_rte' => 'rte' //Enable TinyMCE editor for short description ), array( 'type' => 'text', 'label' => $this->l('Phone:'), 'name' => 'phone', 'size' => 40, 'maxlength' => 16, 'desc' => $this->l('Phone number for this supplier') ), array( 'type' => 'text', 'label' => $this->l('Email:'), 'name' => 'email', 'size' => 40, 'maxlength' => 255, 'desc' => $this->l('Email for this supplier') ), array( 'type' => 'text', 'label' => $this->l('Address:'), 'name' => 'address', 'size' => 100, 'maxlength' => 128, 'required' => true ), array( 'type' => 'text', 'label' => $this->l('Address:').' (2)', 'name' => 'address2', 'size' => 100, 'maxlength' => 128, ), array( 'type' => 'text', 'label' => $this->l('Postal Code/Zip Code:'), 'name' => 'postcode', 'size' => 10, 'maxlength' => 12, 'required' => true, ), array( 'type' => 'text', 'label' => $this->l('City:'), 'name' => 'city', 'size' => 20, 'maxlength' => 32, 'required' => true, ), array( 'type' => 'select', 'label' => $this->l('Country:'), 'name' => 'id_country', 'required' => true, 'default_value' => (int)$this->context->country->id, 'options' => array( 'query' => Country::getCountries($this->context->language->id, false), 'id' => 'id_country', 'name' => 'name', ), ), array( 'type' => 'select', 'label' => $this->l('State'), 'name' => 'id_state', 'options' => array( 'id' => 'id_state', 'query' => array(), 'name' => 'name' ) ), array( 'type' => 'text', 'label' => $this->l('Facebook:'), 'name' => 'facebook', 'size' => 60, 'maxlength' => 255, 'desc' => $this->l('Facebook for this supplier') ), array( 'type' => 'text', 'label' => $this->l('Twitter:'), 'name' => 'twitter', 'size' => 60, 'maxlength' => 255, 'desc' => $this->l('Twitter for this supplier') ), array( 'type' => 'text', 'label' => $this->l('Pinterest:'), 'name' => 'pinterest', 'size' => 60, 'maxlength' => 255, 'desc' => $this->l('Pinterest for this supplier') ), array( 'type' => 'text', 'label' => $this->l('Google+:'), 'name' => 'google', 'size' => 60, 'maxlength' => 255, 'desc' => $this->l('Google+ for this supplier') ), array( 'type' => 'file', 'label' => $this->l('Logo:'), 'name' => 'logo', 'display_image' => true, 'desc' => $this->l('Upload a supplier logo from your computer') ), array( 'type' => 'text', 'label' => $this->l('Meta title:'), 'name' => 'meta_title', 'lang' => true, 'hint' => $this->l('Forbidden characters:').' <>;=#{}' ), array( 'type' => 'text', 'label' => $this->l('Meta description:'), 'name' => 'meta_description', 'lang' => true, 'hint' => $this->l('Forbidden characters:').' <>;=#{}' ), array( 'type' => 'tags', 'label' => $this->l('Meta keywords:'), 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Forbidden characters:').' <>;=#{}', 'desc' => $this->l('To add "tags" click in the field, write something and then press "Enter"') ), array( 'type' => 'radio', 'label' => $this->l('Enable:'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled') ) ) ) ), 'submit' => array( 'title' => $this->l(' Save '), 'class' => 'button' ) ); // loads current address for this supplier - if possible $address = null; if (isset($obj->id)) { $id_address = Address::getAddressIdBySupplierId($obj->id); if ($id_address > 0) $address = new Address((int)$id_address); } // force specific fields values (address) if ($address != null) { $this->fields_value = array( 'id_address' => $address->id, 'phone' => $address->phone, 'address' => $address->address1, 'address2' => $address->address2, 'postcode' => $address->postcode, 'city' => $address->city, 'id_country' => $address->id_country, 'id_state' => $address->id_state, ); } else $this->fields_value = array( 'id_address' => 0, 'id_country' => Configuration::get('PS_COUNTRY_DEFAULT') ); if (Shop::isFeatureActive()) { $this->fields_form['input'][] = array( 'type' => 'shop', 'label' => $this->l('Shop association:'), 'name' => 'checkBoxShopAsso', ); } // set logo image $image = ImageManager::thumbnail(_PS_SUPP_IMG_DIR_.'/'.$this->object->id.'.jpg', $this->table.'_'.(int)$this->object->id.'.'.$this->imageType, 350, $this->imageType, true); $this->fields_value['image'] = $image ? $image : false; $this->fields_value['size'] = $image ? filesize(_PS_SUPP_IMG_DIR_.'/'.$this->object->id.'.jpg') / 1000 : false; return AdminController::renderForm(); } }
  6. Sorry about that Yes, I have PS 1.5.6 And I need to be able to add 5 new items to the form and rearrange them as I like so I need to override the default form completely.
  7. Hi Gonebdg, I tried what you suggested but it didn't work. The sad thing is if I modify the core files they work, so I don't understand why the overitten files arent working.
  8. Hi Fabien, it dies. I've read somewhere that the problem might be return parent::renderForm(); Something that you have to change parent with other controller, but none of the ones Ive tried worked.
  9. Hi, I am trying to override the default AdminSuppliersController.php module adding a few extra field in the form. I copied the file into the override/controller/admin/ folder changed the class name and removed the non-modified functions. Deleted the cache/class_index.php But it is not taken into account. And if I take the modified piece and put in the original file it works, so it is not a problem of the extra piece not working. <?php class AdminSuppliersController extends AdminSuppliersControllerCore { public function renderForm() { // loads current warehouse if (!($obj = $this->loadObject(true))) return; $this->fields_form = array( 'legend' => array( 'title' => $this->l('Suppliers'), 'image' => '../img/admin/suppliers.gif' ), 'input' => array( array( 'type' => 'hidden', 'name' => 'id_address', ), array( 'type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'size' => 40, 'required' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', ), array( 'type' => 'textarea', 'label' => $this->l('Description:'), 'name' => 'description', 'cols' => 60, 'rows' => 10, 'lang' => true, 'hint' => $this->l('Invalid characters:').' <>;=#{}', 'desc' => $this->l('Will appear in the supplier list'), 'autoload_rte' => 'rte' //Enable TinyMCE editor for short description ), array( 'type' => 'text', 'label' => $this->l('Phone:'), 'name' => 'phone', 'size' => 15, 'maxlength' => 16, 'desc' => $this->l('Phone number for this supplier') ), array( 'type' => 'text', 'label' => $this->l('Email:'), 'name' => 'email', 'size' => 15, 'maxlength' => 255, 'desc' => $this->l('Email for this supplier') ), array( 'type' => 'text', 'label' => $this->l('Address:'), 'name' => 'address', 'size' => 100, 'maxlength' => 128, 'required' => true ), array( 'type' => 'text', 'label' => $this->l('Address:').' (2)', 'name' => 'address2', 'size' => 100, 'maxlength' => 128, ), array( 'type' => 'text', 'label' => $this->l('Postal Code/Zip Code:'), 'name' => 'postcode', 'size' => 10, 'maxlength' => 12, 'required' => true, ), array( 'type' => 'text', 'label' => $this->l('City:'), 'name' => 'city', 'size' => 20, 'maxlength' => 32, 'required' => true, ), array( 'type' => 'select', 'label' => $this->l('Country:'), 'name' => 'id_country', 'required' => true, 'default_value' => (int)$this->context->country->id, 'options' => array( 'query' => Country::getCountries($this->context->language->id, false), 'id' => 'id_country', 'name' => 'name', ), ), array( 'type' => 'select', 'label' => $this->l('State'), 'name' => 'id_state', 'options' => array( 'id' => 'id_state', 'query' => array(), 'name' => 'name' ) ), array( 'type' => 'file', 'label' => $this->l('Logo:'), 'name' => 'logo', 'display_image' => true, 'desc' => $this->l('Upload a supplier logo from your computer') ), array( 'type' => 'text', 'label' => $this->l('Meta title:'), 'name' => 'meta_title', 'lang' => true, 'hint' => $this->l('Forbidden characters:').' <>;=#{}' ), array( 'type' => 'text', 'label' => $this->l('Meta description:'), 'name' => 'meta_description', 'lang' => true, 'hint' => $this->l('Forbidden characters:').' <>;=#{}' ), array( 'type' => 'tags', 'label' => $this->l('Meta keywords:'), 'name' => 'meta_keywords', 'lang' => true, 'hint' => $this->l('Forbidden characters:').' <>;=#{}', 'desc' => $this->l('To add "tags" click in the field, write something and then press "Enter"') ), array( 'type' => 'radio', 'label' => $this->l('Enable:'), 'name' => 'active', 'required' => false, 'class' => 't', 'is_bool' => true, 'values' => array( array( 'id' => 'active_on', 'value' => 1, 'label' => $this->l('Enabled') ), array( 'id' => 'active_off', 'value' => 0, 'label' => $this->l('Disabled') ) ) ) ), 'submit' => array( 'title' => $this->l(' Save '), 'class' => 'button' ) ); // loads current address for this supplier - if possible $address = null; if (isset($obj->id)) { $id_address = Address::getAddressIdBySupplierId($obj->id); if ($id_address > 0) $address = new Address((int)$id_address); } // force specific fields values (address) if ($address != null) { $this->fields_value = array( 'id_address' => $address->id, 'phone' => $address->phone, 'address' => $address->address1, 'address2' => $address->address2, 'postcode' => $address->postcode, 'city' => $address->city, 'id_country' => $address->id_country, 'id_state' => $address->id_state, ); } else $this->fields_value = array( 'id_address' => 0, 'id_country' => Configuration::get('PS_COUNTRY_DEFAULT') ); if (Shop::isFeatureActive()) { $this->fields_form['input'][] = array( 'type' => 'shop', 'label' => $this->l('Shop association:'), 'name' => 'checkBoxShopAsso', ); } // set logo image $image = ImageManager::thumbnail(_PS_SUPP_IMG_DIR_.'/'.$this->object->id.'.jpg', $this->table.'_'.(int)$this->object->id.'.'.$this->imageType, 350, $this->imageType, true); $this->fields_value['image'] = $image ? $image : false; $this->fields_value['size'] = $image ? filesize(_PS_SUPP_IMG_DIR_.'/'.$this->object->id.'.jpg') / 1000 : false; return parent::renderForm(); } } The only modification is adding a new form item(Email) after Phone Can someone see or explain me whats wrong. I have done 5 or 6 overrides and all of them worked perfectly.
  10. Hi, I have modified the Block Top Menu adding an option in the backend to put a class="last" in the last item of the menu. I would like to share it in order for the next versions to implement it. These are the changed lines: 60, 70, 119, 152, 382, 383, 384, 572, 573, 580, 581, 593, 600, 627, 651, 661 It works as it is in the website we are developing however it will probably need some work to work in all combinations as it is not included in all cases in the switch at line 586. I am not sure if this is the place to put this, if it isn't can someone move it to the place it belongs. blocktopmenu.php
  11. I found the answer myself. The email that is sent to the customer can be found in mails/en/order_conf.html The class that handles that email is in classes/PaymentModule.php and the method to override is validateOrder Now for the owner of the shop you will have to have the Mail Alerts module installed and the template is in modules/mailalerts/mails/en/new_order.html and the class that handles this is in: modules/mailalerts/mailalerts.php and the method hookActionValidateOrder If someone needs some help contact me and I'll see if I can help you.
  12. Hi, I am using a module called Marketplace where the users can become shops. I modified the core in order to have a list of shops so now a Supplier is considered a shop. I need to modify the orders page in the backend so I can put a new column in that table where it states which products from which shop are in that particular order. I am trying to find where that list of orders is created in order to query the database to get the extra data and put into the column. So far I managed to find where the header is created. adminXXXX\themes\default\template\helpers\list\list_header.tpl But this header is used for all the backend pages with a table. It goes throughout a foreach on $fields_display, but the $fields_display gives me no clues. The attached images are an idea of what I am trying to build.
  13. Hi, I need to modify the system in order to put a random code which is generated when a user buys a deal. Therefore I need to generate the code and send it in the email sent to the customer. I am trying to find where is the controller that puts the info in that email template but I haven't found anything.
×
×
  • Create New...