Jump to content

xxMAGRAOxx

Members
  • Posts

    14
  • Joined

  • Last visited

Profile Information

  • First Name
    Carlos
  • Last Name
    Magno

xxMAGRAOxx's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, i've created a module and i need that the client when install the module create too a cron job that run every day calling cron.php file that is localizated inside module folder. I don't know if i Let the responsability for the client do this under the server configuration or suggest they to user the cron module. The cron module is trustworthy? I probabily will have windows and linux clients. Another question. I need to make a call by php, right? Becouse the prestashop need autentication token on url call. Ex. http:www/myprestashop/admin/modules/mymodule/cron.php or php http:www/myprestashop/admin/modules/mymodule/cron.php Thanks!
  2. I'm import several external product and its ok. The problem is in the future with we have thousand products for import and download image for each product is consume too many time and process. There is one way to, instead of download image, make prestashop to call url, but the problem is WITHOUT modify the front office code(Something like a hook before exibition). I see how the prestashop works and think this is not possible. Any ideas?
  3. I want to install(or download in that case) the module cron job when the user install my module. I know if i mimic the functionality of the AdminModuleController i'll get, but if have an native way to do that will be better. Anybody have an idea?
  4. One simple contribution. There are one hook that is not listed on documentation and is exactly what i need at this moment. It is actionBeforeCartUpdateQty that is called (as the name says) BEFORE add or update product in cart. Oppose the actionCartSave that is called AFTER.
  5. I know there are no hook for download(I see in the list), but what i want is one idea for simulate that. I find the hook displayOrderDetail that is called before the customer see order detail(with product link for download etc etc) and i'm think to do something is this place, but i do know what to do exactly. Maybe open the .tpl file that is called with order detail information and make changes in product link to make his going to my file and do my download, but i do know it is a good idea, because one shop work different from another and i'm not able to predict all situations. I think there is no other way than that override the getFileController.
  6. I want to listen when the customer download the file(For virtual products obviusly) and then block download and force another download. It is can feel strange, but is not too much. I'm import ebooks from webservice and then add in database prestashop. When the customer click on donwload i'll check if the ebook is "my" and if true i will call endpoint in webservice that will download the "my ebook". So... At this time my only idea is override the GetFileControllerCore and make the modification, but as you know, override core functionality is not a good idea. I'm totally beginner in prestashop and if anybody can suggest me or has a better ideal. tell me please. Thanks!1
  7. Forget it. If you want to listen on add or update cart, use the hook actionCartSave and then $this->context->controller->errors[] = Tools::displayError('Max quantity is 1 for this product.', !Tools::getValue('ajax')); for show errors to the front. Is better than override, if you need to distribute your module.
  8. Can you provide me access to code of your module? I'm in this situation at this time. I override the front controller CartController and listen the function processChangeProductInCart, but if i can see you code i will save many time. I'm not lazy man. My time is very, very short. THANKS!!
  9. Yes, you touch in one important point that i pass in a moment. I am avoid to insert anything manually, becouse its more chance of errors, more work and research in code of prestashop, but i think at this time haven't another way. Not in tag becouse tag i instanciate one or other, the problem is in the custom features. Listen, i'm import 50-200 ebooks by xml and the ebooks has custom fields like isbn, author, edition, etc etc. Imagine foreach ebook i create custom feature for each feature. Ex: $idFeatureValue = $product->addFeaturesToDB($idFeatureIDISBN, null, 1); $product->addFeaturesCustomToDB($idFeatureValue, 1, 'isbn123'); $idFeatureValue = $product->addFeaturesToDB($idFeatureIDIdiom, null, 1); $product->addFeaturesCustomToDB($idFeatureValue, 1, 'Brazil'); $idFeatureValue = $product->addFeaturesToDB($idFeatureIDCollectionTitle, null, 1); $product->addFeaturesCustomToDB($idFeatureValue, 1, 'Star Wars'); ... many other custom features ... Can you see? Its very very very poor performance. Can you suggest something for me? ps: I need that field can be editable in adm.
  10. I think is not a good way and i will continue using the Tag Object. $tag->setProducts(array(...) Is not the ideal(In my case), but better than insert manually. But, thanks for the help reply Nemo1. See you
  11. You are right, but my insertion is not simple as that. Nemo1, i see you are a very experience in prestashop. Can you help me in another thing? I cannot unserstand how the product insert the tags. I find another solution. I'm insert the tags of product by the Tag object, but i need to insert by Product object. Can you tell in what function(s) this happen? I'm not able to track the insert process.
  12. I can't believe in prestashop dont have ANY documentation about this. In all another cms i found VERY VERY EASY way and docs for how to insert product by script. I have search around the web and people say "read the source you have access all classes" ARE YOU KIDDING ME? he class Product, adminController has 10000 line of code and i'm trying to see what happen when i put the save button on the admin but its IMPOSSIBLE to track becouse have MANY internal mechanism that impossiblity to understand. tell me if i'm wrong becouse i'm very angry with this.
×
×
  • Create New...