Jump to content

soduno

Members
  • Posts

    18
  • Joined

  • Last visited

Profile Information

  • First Name
    Simon
  • Last Name
    Duun

soduno's Achievements

Newbie

Newbie (1/14)

3

Reputation

  1. Hi. At the moment our Prestashop is displaying products from the subcategory in the topcategory. Example: Our category "Computers for gaming" is showing products from both subcategory: "Accessories for gaming" and "Displays for gaming" (which is under "Computers for gaming"). So Displays, Mice is in the category: "Computers for gaming". As for a gaming display, computers for gaming category is not marked in Product settings (category section). How can that be? We are using Prestashop 1.6.0.9. //Simon
  2. Hi. I have been using Prestashop and their webservice for a long time, but recently noticed a possible bug. When I create a product via the webservice, with all the fields required, Prestashop is not showing the price at the product list or the product it self(front-office). I have to manually save the product (via ui/backend without any changes), and then the prices shows up perfectly. I guess it has something to do with the database needs a refresh, but I am a bit clueless how to solve this issue. Any idears? :-) Regards, Simon
  3. I am developing some modules for Prestashop and having much trouble with javascript caching in the backend. It dosen't matter if I clear cache in performance settings, or disable all javascript/file caching, the javascript file for the plugin is still getting cached. I have a local installation, and all the folders have 777 (to be sure), so write/delete should not be the case. As it is right now, Prestashop has cached an typo-error in the javascript file that does that I cannot continue, because Prestashop won't let me edit the file, no matter how hard I refresh the site (clear caching in browser does not work either). If I open the javascript file directly (browser) it is showing the current version (without typo), so I guess that Prestashop is somehow forcing the cache... I have experienced this in the past, but it helped clearing the cache(browser) but not this time, it seems. Any ideas?
  4. Okay. Seems that I needed to specify that field inside override->classes->Category.php and then add it to $definition array :-)
  5. I am creating a custom field in the categories backend. The custom field is showing correctly (no problems there), but I cannot save any data to it. I am using a override. Do I have to do any other creations than just adding a new array specifying the input that gonna be added like following (to renderForm) in adminCategoryController.php: array( 'type' => 'text', 'name' => 'myCustomField', 'label' => $this->l('custom label'), 'required' => false, 'hint' => $this->l('custom descr'), ), I have seen some examples where modifications to the database is needed, but is that required? Normally, speaking of plugins, you dont need to do any database modifications to that custom field in a plugin. :-) Edit: Ended up creating a module for this instead, since overriding isn't the smartest idea.
  6. I am trying to get images for a product in Prestashop Webservice. Currently I've managed to get description, price, title etc. But when I try to get the images it only gives me the ID of the images, not the complete url. If I go to http://your-url.com/api/images/products/XproductidX I can with no problem get the images, but doing this through the webservice, is apparently a bit more complicated. Here is my code so far: $opt = array( 'resource' => 'products', 'display' => 'full', 'limit' => 5, ); $xml = $webService->get($opt); $resources = $xml->children()->children(); foreach($resources as $product){ if($product->id[0] == 286){ $title = $product->meta_title->language; $description = $product->meta_description->language; $description_short = $product->description_short; $quantity = $product->quantity; $price = $product->price; $wholesale_price = $product->wholesale_price; $images = $product->associations->images; print_r($images); } } With that print_r at the bottom, I am able to receive following: SimpleXMLElement Object ( [@attributes] => Array ( [nodeType] => image [api] => images ) [image] => Array ( [0] => SimpleXMLElement Object ( [id] => 34 ) [1] => SimpleXMLElement Object ( [id] => 35 ) [2] => SimpleXMLElement Object ( [id] => 36 ) [3] => SimpleXMLElement Object ( [id] => 37 ) [4] => SimpleXMLElement Object ( [id] => 38 ) [5] => SimpleXMLElement Object ( [id] => 39 ) [6] => SimpleXMLElement Object ( [id] => 40 ) ) ) This gives me the ID of the images. Is there any way to get the full url, or at least get image url through an resource? Perhaps I am doing this the wrong way? :-) Regards, Simon
  7. This gotta be a bad solution. Never edit core files! Do overrides if you really have to, or even better make it into a module. Edited core files can be lost in a upgrade of your Prestashop installation
  8. I am using Prestashop Webservice to retrieve all product features for a specific product in a loop. The issue I have is that when I get all the features like for example: id_feature_value, it is only giving me the id of the value not the actually name(obvious reasons in this case). Is there a way to print out the name instead of the ID without having to call all features and then join them together? Some example code: $opt = array('resource' => 'products', 'display' => 'full', 'limit' => 4); if (isset($_GET['id'])) $opt['id'] = $_GET['id']; $xml = $webService->get($opt); $resources = $xml->children()->children(); foreach($resources as $resource){ $associations = $resource->associations->product_features->product_features; $associations->id_feature_value; //Only ID $associations->id_feature_value->language[0]; //Have tried, but with no luck } Best, Simon
  9. Very weird indeed. It's the latest Prestashop version. It does the same on another test version, that is an older 1.6 version :/
  10. Thanks for your suggestion(herve25). In the meantime I found out the same thing via admin product controller But. A new issue accured. When I insert a special(specific) price via PHP, it deletes the allready added special prices for the given product. Any Idear why? I use following code: $specificPrice = new SpecificPrice(); $specificPrice->id_product = $featuredProductId; $specificPrice->id_product_attribute = (int)$id_product_attribute; $specificPrice->id_shop = 1; $specificPrice->id_currency = 0; $specificPrice->id_country = 20; $specificPrice->id_group = 0; $specificPrice->id_customer = 0; $specificPrice->price = '-1'; $specificPrice->from_quantity = 1; $specificPrice->reduction = $discountPrice; $specificPrice->reduction_type = 'amount'; $specificPrice->reduction_tax = 1; $specificPrice->from = $countDownTo; $specificPrice->to = $expire; $specificPrice->add(); $addedPriceId = $specificPrice->id;
  11. Note: Be carefull with usage of last entry in a table (it can mess up). Always use insert ID (this will return the correct result all time)
  12. I am creating my own module, so far it works great. However I am looking for a function to set a special price(with date range) for a specific/allready added product via PHP. Also a function to delete that special price just set. Anyone knows if such functionalities exsists in prestashop? Off course its possible to do it manually in the product section, but I want to be able to set it via Php Best, Simon
  13. I know this post is a bit old, but in hope to help other people you can do it this way: $myField = Configuration::get('myFieldName');
  14. I am optimizing performance at our Prestashop. So far it is okay, but I am having some problems with render blocking. It seems that it can't load the CSS file correctly according to google. Anyone has luck solving this? It seems that other prestashop sites has the same issue. Is there a plugin, or perhaps an article explaining this? Best, Simon
  15. Thank you very much for your advice. It helped a lot. I realize that the problem was (as you wrote) external scripts. Right now I have added them to load locally instead and as I can see, the performance has gained aprox 50%. According to scripts. Is there a way to concatenate locally loaded scripts in Prestashop? I could use gulp, however I am not sure if it would crack the modules. I will definitely check Google Tag Manager out
×
×
  • Create New...