-
Posts
87 -
Joined
-
Last visited
About vivek tripathi
- Birthday 01/07/1983
Contact Methods
-
Skype
vivek.kr.tripathi
Profile Information
-
Location
Delhi, India
-
Interests
Prestashop Module, and responsive theme design, Custome , Core modification in prestashop and wordpress
-
Activity
Developer
Recent Profile Visitors
6,837,144 profile views
vivek tripathi's Achievements
Newbie (1/14)
66
Reputation
-
Multicurrency store wrong attributes calculation
vivek tripathi replied to 3dlabtek's topic in OUT - 1.6.0.11 [7 Jan 2015]
Hi All, I was also facing this problem prestashop new release having some bug I hope prestashop team member should resolve these issue before they move for next version release. I don't when they will do . but I have got solution myself by overriding product controller. Process Methode first -------------------------------------------------------------------------- Edit Product controller Open file - controllers -> front- >ProductController.php find code near Line no 445 $combinations[$row['id_product_attribute']]['price'] = (float)$row['price']; Replace With $combinations[$row['id_product_attribute']]['price'] = (float)Tools::convertPrice($row['price'],Context::getContext()->currency); Methode 2 By Overriding Product controller Go to location override\controllers\front\ Create New File name ProductController.php and Write code given below <?php class ProductController extends ProductControllerCore { protected function assignAttributesGroups() { $colors = array(); $groups = array(); // @todo (RM) should only get groups and not all declination ? $attributes_groups = $this->product->getAttributesGroups($this->context->language->id); if (is_array($attributes_groups) && $attributes_groups) { $combination_images = $this->product->getCombinationImages($this->context->language->id); $combination_prices_set = array(); foreach ($attributes_groups as $k => $row) { // Color management if (isset($row['is_color_group']) && $row['is_color_group'] && (isset($row['attribute_color']) && $row['attribute_color']) || (file_exists(_PS_COL_IMG_DIR_ . $row['id_attribute'] . '.jpg'))) { $colors[$row['id_attribute']]['value'] = $row['attribute_color']; $colors[$row['id_attribute']]['name'] = $row['attribute_name']; if (!isset($colors[$row['id_attribute']]['attributes_quantity'])) $colors[$row['id_attribute']]['attributes_quantity'] = 0; $colors[$row['id_attribute']]['attributes_quantity'] += (int) $row['quantity']; } if (!isset($groups[$row['id_attribute_group']])) $groups[$row['id_attribute_group']] = array( 'group_name' => $row['group_name'], 'name' => $row['public_group_name'], 'group_type' => $row['group_type'], 'default' => -1, ); $groups[$row['id_attribute_group']]['attributes'][$row['id_attribute']] = $row['attribute_name']; if ($row['default_on'] && $groups[$row['id_attribute_group']]['default'] == -1) $groups[$row['id_attribute_group']]['default'] = (int) $row['id_attribute']; if (!isset($groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']])) $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] = 0; $groups[$row['id_attribute_group']]['attributes_quantity'][$row['id_attribute']] += (int) $row['quantity']; $combinations[$row['id_product_attribute']]['attributes_values'][$row['id_attribute_group']] = $row['attribute_name']; $combinations[$row['id_product_attribute']]['attributes'][] = (int) $row['id_attribute']; $combinations[$row['id_product_attribute']]['price'] = (float)Tools::convertPrice($row['price'],Context::getContext()->currency); // Call getPriceStatic in order to set $combination_specific_price if (!isset($combination_prices_set[(int) $row['id_product_attribute']])) { Product::getPriceStatic((int) $this->product->id, false, $row['id_product_attribute'], 6, null, false, true, 1, false, null, null, null, $combination_specific_price); $combination_prices_set[(int) $row['id_product_attribute']] = true; $combinations[$row['id_product_attribute']]['specific_price'] = $combination_specific_price; } $combinations[$row['id_product_attribute']]['ecotax'] = (float) $row['ecotax']; $combinations[$row['id_product_attribute']]['weight'] = (float) $row['weight']; $combinations[$row['id_product_attribute']]['quantity'] = (int) $row['quantity']; $combinations[$row['id_product_attribute']]['reference'] = $row['reference']; $combinations[$row['id_product_attribute']]['unit_impact'] = $row['unit_price_impact']; $combinations[$row['id_product_attribute']]['minimal_quantity'] = $row['minimal_quantity']; if ($row['available_date'] != '0000-00-00') { $combinations[$row['id_product_attribute']]['available_date'] = $row['available_date']; $combinations[$row['id_product_attribute']]['date_formatted'] = Tools::displayDate($row['available_date']); } else $combinations[$row['id_product_attribute']]['available_date'] = ''; if (!isset($combination_images[$row['id_product_attribute']][0]['id_image'])) $combinations[$row['id_product_attribute']]['id_image'] = -1; else { $combinations[$row['id_product_attribute']]['id_image'] = $id_image = (int) $combination_images[$row['id_product_attribute']][0]['id_image']; if ($row['default_on']) { if (isset($this->context->smarty->tpl_vars['cover']->value)) $current_cover = $this->context->smarty->tpl_vars['cover']->value; if (is_array($combination_images[$row['id_product_attribute']])) { foreach ($combination_images[$row['id_product_attribute']] as $tmp) if ($tmp['id_image'] == $current_cover['id_image']) { $combinations[$row['id_product_attribute']]['id_image'] = $id_image = (int) $tmp['id_image']; break; } } if ($id_image > 0) { if (isset($this->context->smarty->tpl_vars['images']->value)) $product_images = $this->context->smarty->tpl_vars['images']->value; if (isset($product_images) && is_array($product_images) && isset($product_images[$id_image])) { $product_images[$id_image]['cover'] = 1; $this->context->smarty->assign('mainImage', $product_images[$id_image]); if (count($product_images)) $this->context->smarty->assign('images', $product_images); } if (isset($this->context->smarty->tpl_vars['cover']->value)) $cover = $this->context->smarty->tpl_vars['cover']->value; if (isset($cover) && is_array($cover) && isset($product_images) && is_array($product_images)) { $product_images[$cover['id_image']]['cover'] = 0; if (isset($product_images[$id_image])) $cover = $product_images[$id_image]; $cover['id_image'] = (Configuration::get('PS_LEGACY_IMAGES') ? ($this->product->id . '-' . $id_image) : (int) $id_image); $cover['id_image_only'] = (int) $id_image; $this->context->smarty->assign('cover', $cover); } } } } } // wash attributes list (if some attributes are unavailables and if allowed to wash it) if (!Product::isAvailableWhenOutOfStock($this->product->out_of_stock) && Configuration::get('PS_DISP_UNAVAILABLE_ATTR') == 0) { foreach ($groups as &$group) foreach ($group['attributes_quantity'] as $key => &$quantity) if ($quantity <= 0) unset($group['attributes'][$key]); foreach ($colors as $key => $color) if ($color['attributes_quantity'] <= 0) unset($colors[$key]); } foreach ($combinations as $id_product_attribute => $comb) { $attribute_list = ''; foreach ($comb['attributes'] as $id_attribute) $attribute_list .= '\'' . (int) $id_attribute . '\','; $attribute_list = rtrim($attribute_list, ','); $combinations[$id_product_attribute]['list'] = $attribute_list; } $this->context->smarty->assign(array( 'groups' => $groups, 'colors' => (count($colors)) ? $colors : false, 'combinations' => $combinations, 'combinationImages' => $combination_images )); } } } ?> or Download ProductController.php and place in override folder ProductController.php- 8 replies
-
- 5
-
- currency
- attributes
-
(and 5 more)
Tagged with:
-
Code change to show Type option in birthdaypresent Module Inside your birthdaypresent module create folder override/classess and then create file Discount.php write code class Discount extends DiscountCore { public static function getDiscountTypes($id_lang) { $x=array( 1 =>array('id_discount_type'=>'1','name'=>'Discount on order (%)'), 2 =>array('id_discount_type'=>'2','name'=>'Discount on order (amount)'), 3 =>array('id_discount_type'=>'3','name'=>'Free shiping') ); return $x; } } Step 2- uninstall module and then reinstall Note if still not working then please remove/delete file cache/class_index.php and uninstall and install module it will work and Type option will be visible overAll mean to say override the class Discount since in version 1.5+ getDiscountTypes function not present Second Method ----------------------------------- Replace $discountTypes = Discount::getDiscountTypes((int)($cookie->id_lang)); with the $discountTypes = array( 1 =>array('id_discount_type'=>'1','name'=>'Discount on order (%)'), 2 =>array('id_discount_type'=>'2','name'=>'Discount on order (amount)'), 3 =>array('id_discount_type'=>'3','name'=>'Free shiping') );
-
Override does not work for Product.php Class (v 1.5.2)
vivek tripathi replied to bluego78's topic in Core developers
Many Thanks Big_Berny, you found the solution for me . I removed file cache/class_index.php and it working... It is really helpful for me it is just similar to life saving help. It doesn't matter you have enabled cache or not. I found after each time you override class or controller you have to delete that file to take effect of overriding once you run site that file automatically generated that having record of all your core as well as overridden controller and class file details. If you are changing in same overridden class/ controller you don't need to delete file again and again. -
Hi All I have checked many times this module even I have checked it for Prestashop version 1.5.2.0 to 1.5.4.0 its working properly and and emails are coming please ad email address at module configure section where you want to send email Please also check your shop email system is working properly by going to admin-> Advance parameter -> email and check by sending test email to same email id where product enquiry emails are going One Issue can be arise different language than English If you guys are using different language other than English please make folder of you language in module->productenquiry->mail-> [your language folder name] for example for french make folder name fr and copy en folder content into them. if you are still facing an issue you. I can check it for you if you share admin and ftp details.
-
Hi I have got crack to increse attachment name length for prestashop version 1.5.4 STEP 1 Go to classes/Attachment.php find the code near line no 50 'name' =>array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 32), Replacede with 'name' =>array('type' => self::TYPE_STRING, 'lang' => true, 'validate' => 'isGenericName', 'required' => true, 'size' => 128), STEP 2 go to controllers\admin\AdminProductsController.php Find the function processAddAttachments() inside that fuction find code near line no 463 elseif (Tools::strlen(Tools::getValue('attachment_name_'.(int)($language['id_lang']))) > 32) $this->errors[] = sprintf(Tools::displayError('The name is too long (%d chars max).'), 32); Replace width elseif (Tools::strlen(Tools::getValue('attachment_name_'.(int)($language['id_lang']))) >128) $this->errors[] = sprintf(Tools::displayError('The name is too long (%d chars max).'), 128); STEP 3 Open database table ps_attachment_lang change name field varchar(32) to varchar(128)
-
Hi All Here is the module for product Enquiry / Product Question working well with the Prestashop version 1.5.4.0 tested This modules ads an link similar to send to friend module on click a Enquiry form will open when user fills that form and submit an email goes to Email specified from back end of this module if email not specified Email will goes to default shop email id productenquiry.zip
-
Hi, In order to block category only to show current category from lv1 open file \themes\{THEMEfolder name}\js\tools\treeManagement.js if any theme installed or if defualt theme then open themes\default\js\tools\treeManagement.js Edit function function toggleBranch(jQueryElement, noAnimation) { if(jQueryElement.hasClass('OPEN')) closeBranch(jQueryElement, noAnimation); else openBranch(jQueryElement, noAnimation); } Replaced with function toggleBranch(jQueryElement, noAnimation) { closeBranch($('.OPEN'), noAnimation); if(jQueryElement.hasClass('OPEN')) closeBranch(jQueryElement, noAnimation); else openBranch(jQueryElement, noAnimation); }
-
rollover image in product list
vivek tripathi replied to persephonevintage's topic in Addons, modules and themes developers
Hi , I found a very good module on following http://www.marghoobsuleman.com/prestashop-modules/prestashop-modules-image-enlarger I think it will meet your requirement -
niczchin.pl started following vivek tripathi
-
Hi All First of all thanks to ningu for your code I have add small peace of code to run above code in both condition ajaxcart is activate or deactivated (jquery code in product-listing.tpl file) Here is complete code below some time editor parse code so for convinece I have attached text file having complete code in theme->prodcut-list.tpl Replace {if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2} {l s='Add to cart'} {else} with the following code {if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2} {l s='Quantity :'} <input type="text" name="ajax_qty_to_add_to_cart[{$product.id_product|intval}]" id="quantity_wanted_{$product.id_product|intval}" class="text" value="{if isset($quantityBackup)}{$quantityBackup|intval}{else}1{/if}" size="2" maxlength="3" /> {l s='Add to cart'} {else} In the module->blockcart->ajax-cart.js ajaxCart.add(idProduct, null, false, this); Replace with ajaxCart.add(idProduct, null, false, this, $('#quantity_wanted_'+idProduct).val()); In theme->product-list.tpl add following lin at the top of page {literal} <script type="text/javascript"> $(document).ready(function(){ $(".ajax_add_to_cart_button").click(function(){ var f=$(this).attr('href'); var id = f.split('&')[1].split('=')[1]; var p="#quantity_wanted_"+id; var qty=$(p).attr('value'); g=f+"&qty="+qty; window.location=''+g; return false; }); }); </script> {/literal}
-
Display Manufacture Logos In The Main Page
vivek tripathi replied to Goetten's topic in Core developers
here is a module attached bellow which shows manufacture logo in main page it's just created with the help of block manufacturer you can modify css acording to your view blockmanufacturer2.zip -
Wishlist e-mail greeting
vivek tripathi replied to Bewitching's topic in Addons, modules and themes developers
You have to make few minimal changes to display customer name in email greeting module->blockwishlist->wishlink.txt add {firstname} {lastname} after Hi module->blockwishlist->wishlink.html add {firstname} {lastname} after Hi, Replace module->blockwishlist->wishlist.php if(!sizeof($errors)) { $wishlist = new WishList(); $wishlist->name = $name; $wishlist->id_customer = (int)$cookie->id_customer; list($us, $s) = explode(' ', microtime()); srand($s * $us); $wishlist->token = strtoupper(substr(sha1(uniqid(rand(), true)._COOKIE_KEY_.$cookie->id_customer), 0, 16)); $wishlist->add(); Mail::Send((int)($cookie->id_lang), 'wishlink', Mail::l('Your wishlist\'s link'), array( '{wishlist}' => $wishlist->name, '{message}' => Tools::getProtocol().htmlentities($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/blockwishlist/view.php?token='.$wishlist->token), $cookie->email, $cookie->firstname.' '.$cookie->lastname, NULL, strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); } with the following code if(!sizeof($errors)) { $wishlist = new WishList(); $wishlist->name = $name; $wishlist->id_customer = (int)$cookie->id_customer; list($us, $s) = explode(' ', microtime()); srand($s * $us); $wishlist->token = strtoupper(substr(sha1(uniqid(rand(), true)._COOKIE_KEY_.$cookie->id_customer), 0, 16)); $wishlist->add(); $customer= $wishlist->getByToken($wishlist->token); $wishlist->add(); Mail::Send((int)($cookie->id_lang), 'wishlink', Mail::l('Your wishlist\'s link'), array( '{wishlist}' => $wishlist->name, '{firstname}' => $customer['firstname'], '{firstname}' => $customer['lastname'], '{message}' => Tools::getProtocol().htmlentities($_SERVER['HTTP_HOST'], ENT_COMPAT, 'UTF-8').__PS_BASE_URI__.'modules/blockwishlist/view.php?token='.$wishlist->token), $cookie->email, $cookie->firstname.' '.$cookie->lastname, NULL, strval(Configuration::get('PS_SHOP_NAME')), NULL, NULL, dirname(__FILE__).'/mails/'); } for shake of convenience I attached mywishlist.php code in text file below mywishlist.txt