Jump to content

mohamd.sobhy

Members
  • Posts

    13
  • Joined

  • Last visited

About mohamd.sobhy

  • Birthday 08/25/1985

Profile Information

  • First Name
    Mohamed
  • Last Name
    Sobhy

mohamd.sobhy's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. i tried another thing use {$base_url}+{$token} to get the right url and its working and still waiting for answer
  2. i am working local now from back office working fine with this url : prestashop/en/live_configurator_token=50b2bd2ec1aaf231034c5f1a0be4afc2&id_employee=1&id_shop=1&theme=&theme_font=&live_configurator_token=50b2bd2ec1aaf231034c5f1a0be4afc2&id_shop=1&id_employee=1&theme=theme10&theme_font=font10 but when i put just domain .. not working i tried to regenerate .htaccess file , but also the problem still on any suggestions ?
  3. Thanks for answering , well i want this for one reason i give account for merchant to add their products , and i give them one permission "add new product" can`t give them permission "edit" on their product because i disable all new product by default and give admin permission to enable them by edit so when merchant add new product .. before combinations they have to save and if they save they can not edit !! and put the rest of data ! is there any way to resolve that ?
  4. i want to disable warning .. when it asking for saving many times in > adding new product in file AdminProductsController.php when it say $this->displayWarning($this->l('You must save this product before adding specific combinations')); i just want to save once when it finish adding product public function initFormAttributes($product){ $data = $this->createTemplate($this->tpl_form); if (!Combination::isFeatureActive()) { $this->displayWarning($this->l('This feature has been disabled. '). ' <a href="index.php?tab=AdminPerformance&token='.Tools::getAdminTokenLite('AdminPerformance').'#featuresDetachables">'.$this->l('Performances').'</a>'); } elseif (Validate::isLoadedObject($product)) { if ($this->product_exists_in_shop) { if ($product->is_virtual) { $data->assign('product', $product); $this->displayWarning($this->l('A virtual product cannot have combinations.')); } else { $attribute_js = array(); $attributes = Attribute::getAttributes($this->context->language->id, true); foreach ($attributes as $k => $attribute) { $attribute_js[$attribute['id_attribute_group']][$attribute['id_attribute']] = $attribute['name']; natsort($attribute_js[$attribute['id_attribute_group']]); } $currency = $this->context->currency; $data->assign('attributeJs', $attribute_js); $data->assign('attributes_groups', AttributeGroup::getAttributesGroups($this->context->language->id)); $data->assign('currency', $currency); $images = Image::getImages($this->context->language->id, $product->id); $data->assign('tax_exclude_option', Tax::excludeTaxeOption()); $data->assign('ps_weight_unit', Configuration::get('PS_WEIGHT_UNIT')); $data->assign('ps_use_ecotax', Configuration::get('PS_USE_ECOTAX')); $data->assign('field_value_unity', $this->getFieldValue($product, 'unity')); $data->assign('reasons', $reasons = StockMvtReason::getStockMvtReasons($this->context->language->id)); $data->assign('ps_stock_mvt_reason_default', $ps_stock_mvt_reason_default = Configuration::get('PS_STOCK_MVT_REASON_DEFAULT')); $data->assign('minimal_quantity', $this->getFieldValue($product, 'minimal_quantity') ? $this->getFieldValue($product, 'minimal_quantity') : 1); $data->assign('available_date', ($this->getFieldValue($product, 'available_date') != 0) ? stripslashes(htmlentities($this->getFieldValue($product, 'available_date'), $this->context->language->id)) : '0000-00-00'); $i = 0; $type = ImageType::getByNameNType('%', 'products', 'height'); if (isset($type['name'])) { $data->assign('imageType', $type['name']); } else { $data->assign('imageType', ImageType::getFormatedName('small')); } $data->assign('imageWidth', (isset($image_type['width']) ? (int)($image_type['width']) : 64) + 25); foreach ($images as $k => $image) { $images[$k]['obj'] = new Image($image['id_image']); ++$i; } $data->assign('images', $images); $data->assign($this->tpl_form_vars); $data->assign(array( 'list' => $this->renderListAttributes($product, $currency), 'product' => $product, 'id_category' => $product->getDefaultCategory(), 'token_generator' => Tools::getAdminTokenLite('AdminAttributeGenerator'), 'combination_exists' => (Shop::isFeatureActive() && (Shop::getContextShopGroup()->share_stock) && count(AttributeGroup::getAttributesGroups($this->context->language->id)) > 0 && $product->hasAttributes()) )); } } else { $this->displayWarning($this->l('You must save the product in this shop before adding combinations.')); } } else { $data->assign('product', $product); $this->displayWarning($this->l('You must save this product before adding combinations.')); } $this->tpl_form_vars['custom_form'] = $data->fetch(); }
  5. i want to disable warning .. when it asking for saving many times in > adding new product in file AdminProductsController.php when it say $this->displayWarning($this->l('You must save this product before adding specific pricing')); i just want to save once when it finish adding product public function initFormPrices($obj) { $data = $this->createTemplate($this->tpl_form); $product = $obj; if ($obj->id) { $shops = Shop::getShops(); $countries = Country::getCountries($this->context->language->id); $groups = Group::getGroups($this->context->language->id); $currencies = Currency::getCurrencies(); $attributes = $obj->getAttributesGroups((int)$this->context->language->id); $combinations = array(); foreach ($attributes as $attribute) { $combinations[$attribute['id_product_attribute']]['id_product_attribute'] = $attribute['id_product_attribute']; if (!isset($combinations[$attribute['id_product_attribute']]['attributes'])) { $combinations[$attribute['id_product_attribute']]['attributes'] = ''; } $combinations[$attribute['id_product_attribute']]['attributes'] .= $attribute['attribute_name'].' - '; $combinations[$attribute['id_product_attribute']]['price'] = Tools::displayPrice( Tools::convertPrice( Product::getPriceStatic((int)$obj->id, false, $attribute['id_product_attribute']), $this->context->currency ), $this->context->currency ); } foreach ($combinations as &$combination) { $combination['attributes'] = rtrim($combination['attributes'], ' - '); } $data->assign('specificPriceModificationForm', $this->_displaySpecificPriceModificationForm( $this->context->currency, $shops, $currencies, $countries, $groups) ); $data->assign('ecotax_tax_excl', (float)$obj->ecotax); $this->_applyTaxToEcotax($obj); $data->assign(array( 'shops' => $shops, 'admin_one_shop' => count($this->context->employee->getAssociatedShops()) == 1, 'currencies' => $currencies, 'countries' => $countries, 'groups' => $groups, 'combinations' => $combinations, 'multi_shop' => Shop::isFeatureActive(), 'link' => new Link(), 'pack' => new Pack() )); } else { $this->displayWarning($this->l('You must save this product before adding specific pricing')); $product->id_tax_rules_group = (int)Product::getIdTaxRulesGroupMostUsed(); $data->assign('ecotax_tax_excl', 0); } $address = new Address(); $address->id_country = (int)$this->context->country->id; $tax_rules_groups = TaxRulesGroup::getTaxRulesGroups(true); $tax_rates = array( 0 => array( 'id_tax_rules_group' => 0, 'rates' => array(0), 'computation_method' => 0 ) ); foreach ($tax_rules_groups as $tax_rules_group) { $id_tax_rules_group = (int)$tax_rules_group['id_tax_rules_group']; $tax_calculator = TaxManagerFactory::getManager($address, $id_tax_rules_group)->getTaxCalculator(); $tax_rates[$id_tax_rules_group] = array( 'id_tax_rules_group' => $id_tax_rules_group, 'rates' => array(), 'computation_method' => (int)$tax_calculator->computation_method ); if (isset($tax_calculator->taxes) && count($tax_calculator->taxes)) { foreach ($tax_calculator->taxes as $tax) { $tax_rates[$id_tax_rules_group]['rates'][] = (float)$tax->rate; } } else { $tax_rates[$id_tax_rules_group]['rates'][] = 0; } } // prices part $data->assign(array( 'link' => $this->context->link, 'currency' => $currency = $this->context->currency, 'tax_rules_groups' => $tax_rules_groups, 'taxesRatesByGroup' => $tax_rates, 'ecotaxTaxRate' => Tax::getProductEcotaxRate(), 'tax_exclude_taxe_option' => Tax::excludeTaxeOption(), 'ps_use_ecotax' => Configuration::get('PS_USE_ECOTAX'), )); $product->price = Tools::convertPrice($product->price, $this->context->currency, true, $this->context); if ($product->unit_price_ratio != 0) { $data->assign('unit_price', Tools::ps_round($product->price / $product->unit_price_ratio, 6)); } else { $data->assign('unit_price', 0); } $data->assign('ps_tax', Configuration::get('PS_TAX')); $data->assign('country_display_tax_label', $this->context->country->display_tax_label); $data->assign(array( 'currency', $this->context->currency, 'product' => $product, 'token' => $this->token )); $this->tpl_form_vars['custom_form'] = $data->fetch(); }
  6. how i can show manufacturers random ? <li class="{if $smarty.foreach.manufacturer_list.last}last_item{elseif $smarty.foreach.manufacturer_list.first}first_item{else}item{/if}" style="padding:6px 0 ;border-bottom: 2px solid #888;"> <a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'html'}" title="{l s='More about %s' sprintf=[$manufacturer.name] mod='mib'}"> <img src="{$content_dir}img/m/{$manufacturer.image_url}" alt="{$manufacturer.name|escape:'html':'UTF-8'}"/> </a> </li>
  7. thanks for answering me , i am already using this module but it shows all manufacturers , and i just need to show related manufacturers for sepreated categories
  8. function hookHome($params){ global $smarty, $cookie, $link; $id_customer = (int)$params['cookie']->id_customer; $id_group = $id_customer ? Customer::getDefaultGroupId($id_customer) : _PS_DEFAULT_CUSTOMER_GROUP_; $id_lang = (int)$params['cookie']->id_lang; $result = Db::getInstance(_PS_USE_SQL_SLAVE_)->ExecuteS(' SELECT c.*, cl.* FROM `'._DB_PREFIX_.'category` c LEFT JOIN `'._DB_PREFIX_.'category_lang` cl ON (c.`id_category` = cl.`id_category` AND `id_lang` = '.$id_lang.') LEFT JOIN `'._DB_PREFIX_.'category_group` cg ON (cg.`id_category` = c.`id_category`) WHERE level_depth > 1 And level_depth < 3 AND c.`active` = 1 AND cg.`id_group` = '.$id_group.' ORDER BY 1 ASC'); $category = new Category(1); $nb = intval(Configuration::get('HOME_categories_NBR')); global $link; $this->context->smarty->assign(array( 'categories' => $result, Category::getRootCategories(intval($params['cookie']->id_lang), true), 'link' => $link)); $manufacturers = Manufacturer::getManufacturers(); foreach ($manufacturers as &$manufacturer) { $manufacturer['image'] = $this->context->language->iso_code.'-default'; if (file_exists(_PS_MANU_IMG_DIR_.$manufacturer['id_manufacturer'].'-'.ImageType::getFormatedName('medium').'.jpg')) $manufacturer['image'] = $manufacturer['id_manufacturer']; } $this->context->smarty->assign(array( 'category' => $category, 'lang' => Language::getIsoById(intval($params['cookie']->id_lang)), 'manufacturers' => $manufacturers, 'text_list' => Configuration::get('MANUFACTURER_DISPLAY_TEXT'), 'text_list_nb' => Configuration::get('MANUFACTURER_DISPLAY_TEXT_NB'), 'form_list' => Configuration::get('MANUFACTURER_DISPLAY_FORM'), 'display_link_manufacturer' => Configuration::get('PS_DISPLAY_SUPPLIERS') )); return $this->display(__FILE__, 'wcontentmaker.tpl'); } <div id="wContent-top" class="wContent-top" > {$content} <div class="categories"> <h2>{l s='Categories' mod='homecategories'}</h2> {if isset($categories) AND $categories} <ul> {foreach from=$categories item=category name=homeCategories} {assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)} <li class="ajax_block_category {if $smarty.foreach.homeCategories.first}first_item{elseif $smarty.foreach.homeCategories.last}last_item{else}item{/if}" style="width:1200px; height:300px;background:#EFECEA ;border:1px solid #222; margin:20px;"> <!-- <div> <a href="{$categoryLink}" title="{$category.legend}" class="category_image"> <img src="{$img_cat_dir}{$category.id_category}-large.jpg" alt="{$category.name}" title="{$category.name}" class="categoryImage" width="{$categorySize.width}" height="{$categorySize.height}" /> </a></div>--> <a href="{$categoryLink}" title="{$category.legend}" >{$category.name|truncate:35}</a><br/> <div class="row" style="width:1200px;float:left;"> <div class="col-sm-2 block_content"> <h4 class="title_block">{if $display_link_manufacturer}<a href="{$link->getPageLink('manufacturer')|escape:'html'}" title="{l s='Manufacturers' mod='blockmanufacturer'}">{/if}{l s='Brands' mod='blockmanufacturer'}{if $display_link_manufacturer}</a>{/if}</h4> {if $manufacturers} {if $text_list} <ul class="bullet"> {foreach from=$manufacturers item=manufacturer name=manufacturer_list} {if $smarty.foreach.manufacturer_list.iteration <= $text_list_nb} <li class="{if $smarty.foreach.manufacturer_list.last}last_item{elseif $smarty.foreach.manufacturer_list.first}first_item{else}item{/if}"><a href="{$link->getmanufacturerLink($manufacturer.id_manufacturer, $manufacturer.link_rewrite)|escape:'html'}" title="{l s='More about %s' sprintf=[$manufacturer.name] mod='blockmanufacturer'}"> {$manufacturer.name|escape:'html':'UTF-8'}</a></li> {/if} {/foreach} </ul> {/if} {else} <p>{l s='No manufacturer' mod='blockmanufacturer'}</p> {/if} </div> <div class="col-sm-4"><h4 class="title_block">Slide</h4></div> <div class="col-sm-6"><h4 class="title_block">Products</h4></div> </div> </li> {/foreach} </ul> {else} <p>{l s='No categories' mod='homecategories'}</p> {/if} <div class="cr"></div> </div> </div> how can i display related manufacturers to this category , any one know .. how ?
  9. I just made module that contains all categories and i need to select just manufacturers that related to the same category like this pic i already using module wcontentmaker to create this module
×
×
  • Create New...