-
Posts
52 -
Joined
-
Last visited
Contact Methods
- Website
Profile Information
-
Location
Nantes
-
Activity
Developer
Recent Profile Visitors
474 profile views
zombie process's Achievements
Newbie (1/14)
6
Reputation
-
Invalid Postcode Error
zombie process replied to christmascrackers's topic in Configuring and using PrestaShop
Actually you don't need to tamper with the validate.js. Try this: At the end of the setCountries function in statesManagement.js, comment out the countries = countriesPS; assignement. Then look for the updateState function. The lines if (typeof states !== 'undefined') { $(states).each(function(key, item){ $('#id_state' + (typeof suffix !== 'undefined' ? '_' + suffix : '')).append('<option value="' + parseInt(item.id) + '"' + (idSelectedCountry === item.id ? ' selected="selected"' : '') + '>' + item.name + '</option>'); should be if (typeof states !== 'undefined' && states.states.length && parseInt(states.contains_states)) { $(states.states).each(function(key, item){ $('#id_state' + (typeof suffix !== 'undefined' ? '_' + suffix : '')).append('<option value="' + parseInt(item.id_state) + '"' + (idSelectedState === item.id_state ? ' selected="selected"' : '') + '>' + item.name + '</option>'); }); -
Save First name and Last name of customer in Capitalize format
zombie process replied to jimi007's topic in Core developers
it's Tools::ucfirst -
Save First name and Last name of customer in Capitalize format
zombie process replied to jimi007's topic in Core developers
Well, this should work. can you post the constructor? -
You don't have to get the cart products each time because you already have them (the hook is invoked from the shopping-cart-product-line and the cart's products have already been assigned to smarty). You just need a reference to the current product being displayed. {hook h='pipposhow' mod='pippo' product=$product} public function hookPipposhow($params) { $product = $params['product']; $this->context->smarty->assign(array('id_product' => $product['id_product'])); return $this->display(__FILE__, 'pipposhow.tpl'); }
-
What is the value (or, more generally, the type of data) you want to output? On what is it based? If it's, for instance, based on the product, you can pass the product (or whatever variable you want) as parameter: {hook h='pipposhow' mod='pippo' product=$product othervar=varvalue} In your hook code, you can retrieve the product like so: $product = $params['product'] don't forget, though, to add the $params parameter to the definition of the hook method: public function hookPipposhow($params) { $product = $params['product']; $othervar = $params['othervar']; your code }
-
Changer le prix lors de l'ajout au panier
zombie process replied to WebDevAE's topic in PrestaShop pour les développeurs
On peut pas passer un prix au panier; le prix de chaque produit est récupéré par la méthode getproductprice dans cart.php (getproducts), pour avoir le cout total (getordertotal). Ce qui peut être envisagé: lorsque que la configuration est ajoutée au panier, créer automatiquement un produit (une copie du produit original), changer son prix (le prix calculé par le configurateur), puis ajouter ce dernier au panier. Le produit qui se retrouve dans le panier n'est donc pas l'original mais le produit configuré. Bien sûr cela demandera comment même des modifs ( principalement au niveau du cartcontroller). Juste une idée. -
bug when exporting orders to csv
zombie process replied to juanimela's topic in Configuring and using PrestaShop
A callback, in the context of a list (orders or customers, for instance), is a function meant to alter the display of a value. It can, for instance, replace the active/inactive value (which is either 1 or 0) by an icon. the pdf callback outputs a pdf icon. Now, the problem, as far as csv export is concerned, is that it will receive, for most callbacks, html instead of a value. Which screws up the export because you'll have html code in your cells. Solution is to ignore, in the processexport method, the callback param, and just output the raw value. -
You're welcome. Just occured to me that it's not SORT BY but ORDER BY; but you sorted it out.
-
Changer le prix lors de l'ajout au panier
zombie process replied to WebDevAE's topic in PrestaShop pour les développeurs
Comment fonctionne le configurateur, est'ce qu'il agit sur un produit ou sur un ensemble de produit (genre un produit principal + les produits qui lui servent d'option de configuration) ? -
Own rewrite rules - modifying .htaccess
zombie process replied to Centurio's topic in Core developers
you can change the rewritten name for the order controller in seo & url. The htacces gets generated on many occasions, if you don't want to have to re-edit your htacess I suggest using a route (check the dispatcher class to see how it works) -
Check that the hook has been properly registered. Be sure to include the registerhook call in the module's install method (ie function). Remember that your value is to be used in the pipposhow.tpl that you have to place in your module's views/hook directory. pipposhow.tpl could be like {l s='Pippo show value:' mod='pippo'} {if isset($pipposhow)}{$pipposhow|intval}{/if} the output is then injected into shopping-cart-product-line