Jump to content

DARLEI FERNANDO ZILL

Members
  • Posts

    18
  • Joined

  • Last visited

1 Follower

About DARLEI FERNANDO ZILL

  • Birthday 07/03/1994

Contact Methods

Profile Information

  • Location
    Brasil
  • Activity
    Developer

Recent Profile Visitors

645 profile views

DARLEI FERNANDO ZILL's Achievements

Newbie

Newbie (1/14)

1

Reputation

1

Community Answers

  1. I have a question about the Cookie key and the question of password generation of the platform. 1. I currently have version 1.6.0.14, now I am upgrading to version 1.7.2.4, in a new installation / host, I know that a new key to the cookie is generated when installing this new installation, I wonder if there is any way to update the passwords of all clients according to this new cookie and not use the cookie of the old version? And if I want to change the cookie manually, is there any way to regenerate the passwords arranged in the database? I am doomed to always use the same cookie key? 2. Given the same scenario Store 1.6.0.14, the database has more than 50,000 registered customers, where the chosen encryption passwords is Rijndael with mcrypt library, the question is, if I switch to the class Blowfish adapted, how would be the behavior with the rest of the passwords of the clients already registered? Would they be regenerated with the new encryption class? Would there be an incorrect password error for all clients already in the database?
  2. Yes Nassnus...my function: public function ajaxProcessUpdateImage($idImage, $data) { $img = new Image((int)$idImage); if ($data['cover']) { Image::deleteCover((int)$img->id_product); $img->cover = 1; } $img->legend = $data['legend']; if ($data['infografico']) { $img->infografico = 1; } $img->update(); return $img; }
  3. I recently created a module to add a new attribute to product images It works perfectly with the field added by the module, however the native field "cover" has stopped working (the value is not saved while the module is active). In addition to the module files and overrides (Image.php and AdminProductsController.php), i changed some files from the "src" folder. src/PrestaShopBundle/Controller/Admin/ProductImageController.php ->add('infografico', 'Symfony\Component\Form\Extension\Core\Type\CheckboxType', array( 'label' => $translator->trans('Infográfico', array(), 'Admin.Catalog.Feature'), 'required' => false, )) src/Adapter/Product/AdminProductWrapper.php (ajaxProcessUpdateImage) $img->infografico = $data['infografico']; src/Adapter/Product/ProductDataProvider.php (getImage) 'infografico' => $imageData->infografico ? true : false, src/PrestaShopBundle/Resources/views/Admin/ProductImage/form.html.twig [spam-filter] form_widget(form.infografico) [spam-filter] Am I forgetting something or doing something wrong? Thank you in advance for any help you can give me. My Prestashop version - 1.7.2.1
  4. To block of radio-buttons: {foreach from=$field.availableValues key=chave item=item} <div class="col-md-6 form-control-valign"> <label class="radio-inline"> <span class="custom-radio"> <input name = "doc_type" type = "radio" value = {$chave} id = {if $chave === 1} "id_pf" {else} "id_pj" {/if} onclick = {if $chave === 1} "mostra();mostrapj()" {else} "oculta();ocultapj()" {/if} {if $position eq "edit"} disabled="true" {/if} {if $chave eq $doc_type && $position eq "edit"} checked="checked" {/if} > <span></span> </span> {$item} </label> </div> {/foreach}
  5. I solved by creating an override of the CustomerFormatter class and treating the remainder in customer-form.tpl override/classes/CustomerFormatter.php public function getFormat() { $format = []; $format['id_customer'] = (new FormField) ->setName('id_customer') ->setType('hidden') ; $docField = (new FormField) ->setName('doc_type') ->setType('radio-buttons') ->setLabel( $this->translator->trans( 'Tipo de Cliente', [], 'Shop.Forms.Labels' ) ) ; $docField->addAvailableValue(1, "Pessoa Física"); $docField->addAvailableValue(2, "Pessoa Jurídica"); $format[$docField->getName()] = $docField; $format['cpf'] = (new FormField) ->setName('cpf') ->setLabel( $this->translator->trans( 'Número do CPF', [], 'Shop.Forms.Labels' ) ) ; .... customer-form.tpl: {foreach from=$formFields item="field"} {block "form_field"} {if $field.name === 'cpf'} <div class="form-group row" id="fieldCPF" style="display:none"> <label class="col-md-3 form-control-label required"> {$field.label} </label> <div class="col-md-6"> <input class="form-control" name="{$field.name}" type="{$field.type}" value="{$field.value}" {if $field.required}required{/if} > </div> </div> {elseif $field.name === 'cnpj' or $field.name === 'razaosocial' or $field.name==='rg_ie'} ..... I solved by creating an override of the CustomerFormatter class and treating the remainder in customer-form.tpl
  6. How can I insert an attribute (id) into the input (radio) of my form? I tried some ways but I did not succeed, could anyone give me a tip? My last attempt...: CustomerFormatter.php: getFormat(){} $doc_typeField = (new FormField) ->setName('doc_type') ->setType('radio-buttons') ->setLabel( $this->translator->trans( 'Tipo de Documento', [], 'Shop.Forms.Labels' ) ) ; $doc_typeField->addAvailableValue(1, "Pessoa Física")->addAvailableValue('id', 'id_pf');
  7. Check if the database is configured in settings.inc.php file. And check the ps_shop_url table in the database.
  8. Hello , someone could help me , I need to find the file that controls the export CSV files containing orders. I must address a specific field replacing the dot (.) in value by a comma (,). But I did not encounter code that controls this generation of csv files
  9. Hello, I'm struggling to attach a .pdf file in my email My code is: original code: $pdf = new PDF($invoice, PDF::TEMPLATE_DELIVERY_SLIP, $context->smarty); $file_attachement['content'] = $pdf->render(false); $file_attachement['name'] = Configuration::get('PS_DELIVERY_PREFIX', Context::getContext()->language->id, null, $this->order->id_shop).sprintf('%06d', $this->order->delivery_number).'.pdf'; $file_attachement['mime'] = 'application/pdf'; my code: $file_attachement['content'] = file_get_contents('http://www.mysite.com.br/boletos/boleto1.pdf'); $file_attachement['name'] = 'Boleto.pdf'; $file_attachement['mime'] = 'application/pdf'; ... The file is attached and is sending, but is empty I think I'm missing the part of the ['content'], but I have no idea what to do
  10. Controllers -> Admin -> AdminOrdersController or Override -> Controllers -> Admin -> AdminOrdersController
  11. You put the display.tpl within the correct folder? Place inside the front folder as follows YOURMODULE / views / templates / front / display.tpl Otherwise the controller will not pull the tpl and will return this error Had this problem recently and managed to solve so, you may have already solved too, but if it happens to someone with need this information An simple axample:
  12. Recently updated the php version to 5.4, then began to return this error to me. Catchable fatal error: Argument 1 passed to RecursiveIteratorIterator::__construct() must be an instance of Traversable, instance of RecursiveDirectoryIterator given, called in .../public_html/_gama/tools/smarty/Smarty.class.php on line 845 and defined in .../public_html/_gama/tools/smarty/sysplugins/smarty_internal_cacheresource_file.php on line196 Seems to be something related to clearcache, anyone know how to fix? Prestashop 1.6.0.14
  13. The theme is electronues . I want to put blockviewed using the settings of cshometab model . The TabClass.php is in Cshometab . My idea is to put in the product page , as it is, and also with the Cshometab guides . My doubt is how do I install the hooks , which pass as parameters in the function.
  14. How should I set the Hooks in blockviewed.php to appear listed in my Cshometab. I know that after I set the TabClass.php in cshometab module... What I have done ... : BlockViewed.php: .... public function hookdisplayHomeTabContent($params) { } public function hookdisplayHomeTab($params) { }.... TabClass.php ..... elseif(strpos($this->product_type, "products_viewed") !== false) { unset($this->product_list); /*$this->product_list = BlockViewed::getProductsViewed((int)($cookie->id_lang), 0, $nb); $link=new Link(); $this->view_more= '';*/ $productsViewed = (isset($cookie->viewed) && !empty($cookie->viewed)) ? array_slice(array_reverse(explode(',', $cookie->viewed)), 0, Configuration::get('PRODUCTS_VIEWED_NBR')) : array(); if (count($productsViewed)) { $defaultCover = Language::getIsoById($cookie->id_lang).'-default'; $productIds = implode(',', array_map('intval', $productsViewed)); $count = count($productsViewed); for($i = 0; $i < $count; $i++){ $productsImages[] = Db::getInstance()->getRow(' SELECT MAX(image_shop.id_image) id_image, p.*, il.legend, product_shop.active, pl.name, pl.description_short, pl.link_rewrite, cl.link_rewrite AS category_rewrite FROM '._DB_PREFIX_.'product p '.Shop::addSqlAssociation('product', 'p').' LEFT JOIN '._DB_PREFIX_.'product_lang pl ON (pl.id_product = p.id_product'.Shop::addSqlRestrictionOnLang('pl').') LEFT JOIN '._DB_PREFIX_.'image i ON (i.id_product = p.id_product)'.' LEFT JOIN '._DB_PREFIX_.'product_attribute pa ON (pa.id_product = p.id_product)'. Shop::addSqlAssociation('image', 'i', false, 'image_shop.cover=1').' LEFT JOIN '._DB_PREFIX_.'image_lang il ON (il.id_image = image_shop.id_image AND il.id_lang = '.(int)($cookie->id_lang).') LEFT JOIN '._DB_PREFIX_.'category_lang cl ON (cl.id_category = product_shop.id_category_default'.Shop::addSqlRestrictionOnLang('cl').') WHERE p.id_product = '.$productsViewed[$i].' AND pl.id_lang = '.(int)($cookie->id_lang).' AND cl.id_lang = '.(int)($cookie->id_lang).' GROUP BY product_shop.id_product' ); } $productsImagesArray = array(); foreach ($productsImages as $pi){ $productsImagesArray[$pi['id_product']] = $pi; $productsImagesArray[$pi['id_product']]['link'] = _PS_BASE_URL_.__PS_BASE_URI__.$pi['category_rewrite'].'/'.$pi['link_rewrite'].'-'.$pi['id_product'].'.html'; $productsImagesArray[$pi['id_product']]['quantity_all_versions'] = $pi['quantity']; $productsImagesArray[$pi['id_product']]['allow_oosp'] = Product::isAvailableWhenOutOfStock($pi['out_of_stock']); $productsImagesArray[$pi['id_product']]['reduction'] = Product::getPriceStatic((int)$pi['id_product'],(bool)$usetax,(int)$PI['id_product_attribute'], 6,null,true,true,1,true,null,null,null,$specific_prices); $productsImagesArray[$pi['id_product']]['specific_prices'] = $specific_prices; $ipa_default = Product::getDefaultAttribute($pi['id_product']); $productsImagesArray[$pi['id_product']]['id_product_attribute'] = $ipa_default; //echo "<br><br><br>".$ipa_default."<br><br><br>"; $productsImagesArray[$pi['id_product']]['price_without_reduction'] = Product::getPriceStatic((int)$pi['id_product'],false, ((isset($ipa_default) && !empty($ipa_default)) ? (int)$ipa_default : null),2,null,false,false); } $this->productsViewed = count($productsViewed); //var_dump($productsImagesArray); foreach($productsImagesArray as $item) $this->product_list[] = $item; //var_dump($this->product_list); } } .... This almost ready , just do not know how to set the hooks , someone give me a light?
×
×
  • Create New...