Jump to content

Sono_fre

Members
  • Posts

    3
  • Joined

  • Last visited

Profile Information

  • Location
    Italy
  • Activity
    Agency

Sono_fre's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi all, i'm new and i'm developing a plugin for prestashop, and i have some problems on understanding the prestashop workflow. I have added several forms in the plugin and all are intercepted by postProcess method, and this is ok. What i'm trying to do is to save the values "somewhere" so even after different calls of different forms, the values of olds submitted forms are still retrievable. I'm currently trying to use $this->context->employee to save values but without any luck. I'll give you an example just to make sure what i would like to achieve: I have 2 forms Select Day form with input field day Select month form with input field month Select day |_______| |_SUBMIT_| Select month |_______| |_SUBMIT_| I insert day and submit it, catch the value in the postProcess and save it somewhere, (now i do $this->context->employee->selected_day = Tools::getValue('dayinputfield'); $this->context->employee->update(); ) Now i insert the month and i press submit but the value $this->context->employee->selected_day is now longer avaible...is null What i'm missing? What is the best practice in cases like this? Thanks for the answers!
  2. I'm able to read the friendly url from db, i made this query that actually works: select ps_product.id_product as "id", ps_product_lang.name as "name", ps_product_lang.description_short as "description", ps_product.wholesale_price * 1.22 as "wholesale_price", ps_product.price * 1.22 as "retail_price", ps_product.ean13 as "EAN13", ifnull(ps_configuration.value,'example.com'), '/', ps_product.id_product , '-', ps_product_lang.link_rewrite , '.html') as "product_url" into outfile '/tmp/products.csv' fields terminated by ',' optionally enclosed by '"' escaped by '\\' lines terminated by '\n' from ps_product, ps_product_lang , ps_configuration where ps_configuration.name = 'PS_SHOP_DOMAIN' and ps_product.id_product = ps_product_lang.id_product and ps_product.active = true and ps_product_lang.id_lang = (select value from ps_configuration where name = "PS_LANG_DEFAULT"); I just ignored the category and let the shop redirect me while accessing to the the url built as above, hope this could help someone
  3. Hi all ! I'm trying to execute a query on a prestashop 1.4 db in order to extract all the products, but i'm missing something when trying to retrieve a product category given a product in order to calculate the exact product url as domain/category/product_id-product-name.html. Here i'm trying to extract all the products with urls: select ps_product.id_product as "id", ps_product_lang.name as "name", ps_product_lang.description_short as "description", ps_product.wholesale_price * 1.22 as "wholesale_price", ps_product.price * 1.22 as "retail_price", ps_product.ean13 as "EAN13", ifnull(ps_configuration.value,'examplet.com'), '/', clang.link_rewrite , '/' , ps_product.id_product , '-', ps_product_lang.link_rewrite , '.html') as "product_url" into outfile '/tmp/products.csv' fields terminated by ',' optionally enclosed by '"' escaped by '\\' lines terminated by '\n' from ps_product, ps_product_lang , ps_configuration , ps_category_lang clang where clang.id_shop = ps_product_lang.id_shop and clang.id_lang = ps_product_lang.id_lang and clang.id_category = ps_product_lang.id_product and ps_configuration.name = 'PS_SHOP_DOMAIN' and ps_product.id_product = ps_product_lang.id_product and ps_product.active = true and ps_product_lang.id_lang = (select value from ps_configuration where name = "PS_LANG_DEFAULT"); The problem is that this query gives me only 177 items while the whole catalogue is of about 1777 products. For documentation purpose this is the query that i'm using to extract correctly all the products from the db: select ps_product.id_product as "id", ps_product_lang.name as "name", ps_product_lang.description_short as "description", ps_product.wholesale_price * 1.22 as "wholesale_price", ps_product.price * 1.22 as "retail_price", ps_product.ean13 as "EAN13" into outfile '/tmp/products.csv' fields terminated by ',' optionally enclosed by '"' escaped by '\\' lines terminated by '\n' from ps_product, ps_product_lang where ps_product.id_product = ps_product_lang.id_product and ps_product.active = true and ps_product_lang.id_lang = (select value from ps_configuration where name = "PS_LANG_DEFAULT"); Any help will be appreciated, thanks.
×
×
  • Create New...