diff --git a/core/lib/Thelia/Config/Resources/action.xml b/core/lib/Thelia/Config/Resources/action.xml index b67455f2c..f7ef4806d 100755 --- a/core/lib/Thelia/Config/Resources/action.xml +++ b/core/lib/Thelia/Config/Resources/action.xml @@ -42,6 +42,11 @@ + + + + + diff --git a/core/lib/Thelia/Config/Resources/routing/admin.xml b/core/lib/Thelia/Config/Resources/routing/admin.xml index ca76db188..af7c950af 100755 --- a/core/lib/Thelia/Config/Resources/routing/admin.xml +++ b/core/lib/Thelia/Config/Resources/routing/admin.xml @@ -114,6 +114,50 @@ xml|json + + + + Thelia\Controller\Admin\ProductController::defaultAction + + + + Thelia\Controller\Admin\ProductController::createAction + + + + Thelia\Controller\Admin\ProductController::updateAction + + + + Thelia\Controller\Admin\ProductController::processUpdateAction + + + + Thelia\Controller\Admin\ProductController::setToggleVisibilityAction + + + + Thelia\Controller\Admin\ProductController::deleteAction + + + + Thelia\Controller\Admin\ProductController::updatePositionAction + + + + Thelia\Controller\Admin\ProductController::addRelatedContentAction + + + + Thelia\Controller\Admin\ProductController::deleteRelatedContentAction + + + + Thelia\Controller\Admin\ProductController::getAvailableRelatedContentAction + xml|json + + + diff --git a/core/lib/Thelia/Controller/Admin/CategoryController.php b/core/lib/Thelia/Controller/Admin/CategoryController.php index 7f19fd73e..8c74c31ec 100755 --- a/core/lib/Thelia/Controller/Admin/CategoryController.php +++ b/core/lib/Thelia/Controller/Admin/CategoryController.php @@ -169,9 +169,14 @@ class CategoryController extends AbstractCrudController } protected function renderListTemplate($currentOrder) { + + // Get product order + $product_order = $this->getListOrderFromSession('product', 'product_order', 'manual'); + return $this->render('categories', array( 'category_order' => $currentOrder, + 'product_order' => $product_order, 'category_id' => $this->getRequest()->get('category_id', 0) )); } diff --git a/core/lib/Thelia/Core/Event/TheliaEvents.php b/core/lib/Thelia/Core/Event/TheliaEvents.php index bab268613..dab2db208 100755 --- a/core/lib/Thelia/Core/Event/TheliaEvents.php +++ b/core/lib/Thelia/Core/Event/TheliaEvents.php @@ -165,6 +165,26 @@ final class TheliaEvents const BEFORE_UPDATECATEGORY = "action.before_updateCategory"; const AFTER_UPDATECATEGORY = "action.after_updateCategory"; + // -- Product management ----------------------------------------------- + + const PRODUCT_CREATE = "action.createProduct"; + const PRODUCT_UPDATE = "action.updateProduct"; + const PRODUCT_DELETE = "action.deleteProduct"; + const PRODUCT_TOGGLE_VISIBILITY = "action.toggleProductVisibility"; + const PRODUCT_UPDATE_POSITION = "action.updateProductPosition"; + + const PRODUCT_ADD_CONTENT = "action.productAddContent"; + const PRODUCT_REMOVE_CONTENT = "action.productRemoveContent"; + + const BEFORE_CREATEPRODUCT = "action.before_createproduct"; + const AFTER_CREATEPRODUCT = "action.after_createproduct"; + + const BEFORE_DELETEPRODUCT = "action.before_deleteproduct"; + const AFTER_DELETEPRODUCT = "action.after_deleteproduct"; + + const BEFORE_UPDATEPRODUCT = "action.before_updateProduct"; + const AFTER_UPDATEPRODUCT = "action.after_updateProduct"; + /** * sent when a new existing cat id duplicated. This append when current customer is different from current cart */ diff --git a/core/lib/Thelia/Core/Template/Loop/Product.php b/core/lib/Thelia/Core/Template/Loop/Product.php index d0d8dc5b7..40ad30d80 100755 --- a/core/lib/Thelia/Core/Template/Loop/Product.php +++ b/core/lib/Thelia/Core/Template/Loop/Product.php @@ -89,7 +89,7 @@ class Product extends BaseI18nLoop new Argument( 'order', new TypeCollection( - new Type\EnumListType(array('alpha', 'alpha_reverse', 'min_price', 'max_price', 'manual', 'manual_reverse', 'ref', 'promo', 'new', 'random', 'given_id')) + new Type\EnumListType(array('id', 'id_reverse', 'alpha', 'alpha_reverse', 'min_price', 'max_price', 'manual', 'manual_reverse', 'ref', 'promo', 'new', 'random', 'given_id')) ), 'alpha' ), @@ -536,6 +536,12 @@ class Product extends BaseI18nLoop foreach ($orders as $order) { switch ($order) { + case "id": + $search->orderById(Criteria::ASC); + break; + case "id_reverse": + $search->orderById(Criteria::DESC); + break; case "alpha": $search->addAscendingOrderByColumn('i18n_TITLE'); break; diff --git a/core/lib/Thelia/Form/CategoryCreationForm.php b/core/lib/Thelia/Form/CategoryCreationForm.php index 5da76c8ba..6a0172180 100755 --- a/core/lib/Thelia/Form/CategoryCreationForm.php +++ b/core/lib/Thelia/Form/CategoryCreationForm.php @@ -53,7 +53,7 @@ class CategoryCreationForm extends BaseForm "label_attr" => array("for" => "locale_create") )) ->add("visible", "integer", array( - "label" => Translator::getInstance()->trans("This category is online on the front office."), + "label" => Translator::getInstance()->trans("This category is online."), "label_attr" => array("for" => "visible_create") )) ; diff --git a/core/lib/Thelia/Form/ProductCreationForm.php b/core/lib/Thelia/Form/ProductCreationForm.php index 396f6d0d5..49ab76fb7 100644 --- a/core/lib/Thelia/Form/ProductCreationForm.php +++ b/core/lib/Thelia/Form/ProductCreationForm.php @@ -47,7 +47,7 @@ class ProductCreationForm extends BaseForm "for" => "title" ) )) - ->add("parent", "integer", array( + ->add("default_category", "integer", array( "constraints" => array( new NotBlank() ) @@ -57,7 +57,11 @@ class ProductCreationForm extends BaseForm new NotBlank() ) )) - ; + ->add("visible", "integer", array( + "label" => Translator::getInstance()->trans("This product is online."), + "label_attr" => array("for" => "visible_create") + )) + ; } public function getName() diff --git a/core/lib/Thelia/Model/Map/AttributeCombinationTableMap.php b/core/lib/Thelia/Model/Map/AttributeCombinationTableMap.php index a4b3520e7..c13b85bbf 100644 --- a/core/lib/Thelia/Model/Map/AttributeCombinationTableMap.php +++ b/core/lib/Thelia/Model/Map/AttributeCombinationTableMap.php @@ -159,7 +159,7 @@ class AttributeCombinationTableMap extends TableMap { $this->addRelation('Attribute', '\\Thelia\\Model\\Attribute', RelationMap::MANY_TO_ONE, array('attribute_id' => 'id', ), 'CASCADE', 'RESTRICT'); $this->addRelation('AttributeAv', '\\Thelia\\Model\\AttributeAv', RelationMap::MANY_TO_ONE, array('attribute_av_id' => 'id', ), 'CASCADE', 'RESTRICT'); - $this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::MANY_TO_ONE, array('product_sale_elements_id' => 'id', ), null, null); + $this->addRelation('ProductSaleElements', '\\Thelia\\Model\\ProductSaleElements', RelationMap::MANY_TO_ONE, array('product_sale_elements_id' => 'id', ), 'CASCADE', 'RESTRICT'); } // buildRelations() /** diff --git a/core/lib/Thelia/Model/Map/ProductSaleElementsTableMap.php b/core/lib/Thelia/Model/Map/ProductSaleElementsTableMap.php index 9025784bc..fc23ae569 100644 --- a/core/lib/Thelia/Model/Map/ProductSaleElementsTableMap.php +++ b/core/lib/Thelia/Model/Map/ProductSaleElementsTableMap.php @@ -182,7 +182,7 @@ class ProductSaleElementsTableMap extends TableMap public function buildRelations() { $this->addRelation('Product', '\\Thelia\\Model\\Product', RelationMap::MANY_TO_ONE, array('product_id' => 'id', ), 'CASCADE', 'RESTRICT'); - $this->addRelation('AttributeCombination', '\\Thelia\\Model\\AttributeCombination', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), null, null, 'AttributeCombinations'); + $this->addRelation('AttributeCombination', '\\Thelia\\Model\\AttributeCombination', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), 'CASCADE', 'RESTRICT', 'AttributeCombinations'); $this->addRelation('CartItem', '\\Thelia\\Model\\CartItem', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), null, null, 'CartItems'); $this->addRelation('ProductPrice', '\\Thelia\\Model\\ProductPrice', RelationMap::ONE_TO_MANY, array('id' => 'product_sale_elements_id', ), 'CASCADE', null, 'ProductPrices'); } // buildRelations() @@ -206,6 +206,7 @@ class ProductSaleElementsTableMap extends TableMap { // Invalidate objects in ".$this->getClassNameFromBuilder($joinedTableTableMapBuilder)." instance pool, // since one or more of them may be deleted by ON DELETE CASCADE/SETNULL rule. + AttributeCombinationTableMap::clearInstancePool(); ProductPriceTableMap::clearInstancePool(); } diff --git a/core/lib/Thelia/Model/Product.php b/core/lib/Thelia/Model/Product.php index ca36fd5e7..c770379b9 100755 --- a/core/lib/Thelia/Model/Product.php +++ b/core/lib/Thelia/Model/Product.php @@ -7,6 +7,8 @@ use Thelia\Model\Base\Product as BaseProduct; use Thelia\Tools\URL; use Thelia\TaxEngine\Calculator; use Propel\Runtime\Connection\ConnectionInterface; +use Thelia\Core\Event\TheliaEvents; +use Thelia\Core\Event\ProductEvent; class Product extends BaseProduct { @@ -41,6 +43,45 @@ class Product extends BaseProduct return round($taxCalculator->load($this, $country)->getTaxedPrice($this->getRealLowestPrice()), 2); } + /** + * @return the current default category for this product + */ + public function getDefaultCategory() { + // Find default category + $default_category = ProductCategoryQuery::create() + ->filterByProductId($this->getId()) + ->filterByDefaultCategory(true) + ->findOne(); + + return $default_category; + } + + /** + * Set default category for this product + * + * @param integer $categoryId the new default category id + */ + public function setDefaultCategory($categoryId) { + + // Unset previous category + ProductCategoryQuery::create() + ->filterByProductId($this->getId()) + ->filterByDefaultCategory(true) + ->find() + ->setByDefault(false) + ->save(); + + // Set new default category + ProductCategoryQuery::create() + ->filterByProductId($this->getId()) + ->filterByCategoryId($categoryId) + ->find() + ->setByDefault(true) + ->save(); + + return $this; + } + /** * Calculate next position relative to our default category */ @@ -60,6 +101,53 @@ class Product extends BaseProduct $this->generateRewritenUrl($this->getLocale()); + $this->dispatchEvent(TheliaEvents::BEFORE_CREATEPRODUCT, new ProductEvent($this)); + return true; } + + /** + * {@inheritDoc} + */ + public function postInsert(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::AFTER_CREATEPRODUCT, new ProductEvent($this)); + } + + /** + * {@inheritDoc} + */ + public function preUpdate(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::BEFORE_UPDATEPRODUCT, new ProductEvent($this)); + + return true; + } + + /** + * {@inheritDoc} + */ + public function postUpdate(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::AFTER_UPDATEPRODUCT, new ProductEvent($this)); + } + + /** + * {@inheritDoc} + */ + public function preDelete(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::BEFORE_DELETEPRODUCT, new ProductEvent($this)); + + return true; + } + + /** + * {@inheritDoc} + */ + public function postDelete(ConnectionInterface $con = null) + { + $this->dispatchEvent(TheliaEvents::AFTER_DELETEPRODUCT, new ProductEvent($this)); + } + } diff --git a/install/faker.php b/install/faker.php index 4cb5169c8..3d48fc0e1 100755 --- a/install/faker.php +++ b/install/faker.php @@ -449,11 +449,14 @@ try { } } - echo "Generating coupns fixtures\n"; + echo "Generating coupons fixtures\n"; generateCouponFixtures($thelia); $con->commit(); + + echo "Successfully terminated.\n"; + } catch (Exception $e) { echo "error : ".$e->getMessage()."\n"; $con->rollBack(); diff --git a/install/thelia.sql b/install/thelia.sql index dd3247d57..3dc5d0454 100755 --- a/install/thelia.sql +++ b/install/thelia.sql @@ -343,6 +343,8 @@ CREATE TABLE `attribute_combination` CONSTRAINT `fk_attribute_combination_product_sale_elements_id` FOREIGN KEY (`product_sale_elements_id`) REFERENCES `product_sale_elements` (`id`) + ON UPDATE RESTRICT + ON DELETE CASCADE ) ENGINE=InnoDB; -- --------------------------------------------------------------------- @@ -893,9 +895,8 @@ CREATE TABLE `area_delivery_module` `created_at` DATETIME, `updated_at` DATETIME, PRIMARY KEY (`id`), - UNIQUE INDEX `delivery_module_id_area_id_UNIQUE` (`area_id`, `delivery_module_id`), INDEX `idx_area_delivery_module_area_id` (`area_id`), - INDEX `idx_area_delivery_module_delivery_module_id` (`delivery_module_id`), + INDEX `idx_area_delivery_module_delivery_module_id_idx` (`delivery_module_id`), CONSTRAINT `fk_area_delivery_module_area_id` FOREIGN KEY (`area_id`) REFERENCES `area` (`id`) diff --git a/local/config/schema.xml b/local/config/schema.xml index 9b52fff61..a43cfda56 100755 --- a/local/config/schema.xml +++ b/local/config/schema.xml @@ -1,1203 +1,1199 @@ - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - -
- - - - - - - -
-
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + +
+ + + + + + + +
+
diff --git a/templates/admin/default/categories.html b/templates/admin/default/categories.html index 32b9e6cba..b2ca8440e 100755 --- a/templates/admin/default/categories.html +++ b/templates/admin/default/categories.html @@ -16,6 +16,7 @@
+
{* display parent category name, and get current cat ID *} @@ -171,6 +172,162 @@ {/elseloop}
+
+
+
+ +{* -- PRODUCT MANAGEMENT ---------------------------------------------------- *} + +
+
+
+ + + + + {ifloop rel="product_list"} + + + + + + + + + + + + + + + + {loop name="product_list" type="product" visible="*" category_default=$category_id order=$product_order} + + + + + + + + {module_include location='product_list_row'} + + + + + + + + {/loop} + + {/ifloop} + + {elseloop rel="product_list"} + + + + + + {/elseloop} +
+ {* display parent category name *} + {loop name="category_title" type="category" visible="*" id=$category_id} + {intl l="Products in %cat" cat=$TITLE} + {/loop} + + {elseloop rel="category_title"} + {intl l="Top level Products"} + {/elseloop} + + {module_include location='product_list_caption'} + + + + +
+ {admin_sortable_header + current_order=$product_order + order='id' + reverse_order='id_reverse' + path={url path='/admin/categories' id_category=$category_id target='products'} + label="{intl l='ID'}" + } + +   + {admin_sortable_header + current_order=$product_order + order='ref' + reverse_order='ref_reverse' + path={url path='/admin/categories' id_category=$category_id target='products'} + label="{intl l='Reference'}" + } + + {admin_sortable_header + current_order=$product_order + order='alpha' + reverse_order='alpha_reverse' + path={url path='/admin/categories' id_category=$category_id target='products'} + label="{intl l='Product title'}" + } + + {module_include location='product_list_header'} + + + {admin_sortable_header + current_order=$product_order + order='visible' + reverse_order='visible_reverse' + path={url path='/admin/categories' id_category=$category_id target='products'} + label="{intl l='Online'}" + } + + {admin_sortable_header + current_order=$product_order + order='manual' + reverse_order='manual_reverse' + path={url path='/admin/categories' id_category=$category_id target='products'} + label="{intl l='Position'}" + } +  
{$ID} + {loop type="image" name="cat_image" source="product" source_id="$ID" limit="1" width="50" height="50" resize_mode="crop" backend_context="1"} + + {$TITLE} + + {/loop} + + {$REF}{$TITLE} + {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.products.edit"} +
+ +
+ {/loop} + + {elseloop rel="can_delete"} +
+ +
+ {/elseloop} +
+ {admin_position_block + permission="admin.product.edit" + path={url path='admin/product' category_id=$ID} + url_parameter="product_id" + in_place_edit_class="productPositionChange" + position=$POSITION + id=$ID + } + +
+ {loop type="auth" name="can_change" roles="ADMIN" permissions="admin.product.edit"} + + {/loop} + + {loop type="auth" name="can_delete" roles="ADMIN" permissions="admin.product.delete"} + + {/loop} +
+
{intl l="This category doesn't contains any products. To add a new product, click the + button above."}
+ +
@@ -178,6 +335,10 @@ {module_include location='categories_bottom'} + + {module_include location='catalog_bottom'} + + @@ -251,7 +412,7 @@ {/form} - {* Delete confirmation dialog *} + {* Delete category confirmation dialog *} {capture "category_delete_dialog"} @@ -270,6 +431,26 @@ form_action = {url path='/admin/categories/delete'} form_content = {$smarty.capture.category_delete_dialog nofilter} } + + {* Delete product confirmation dialog *} + + {capture "product_delete_dialog"} + + + {module_include location='product_delete_form'} + + {/capture} + + {include + file = "includes/generic-confirm-dialog.html" + + dialog_id = "product_delete_dialog" + dialog_title = {intl l="Delete product"} + dialog_message = {intl l="Do you really want to delete this product ?"} + + form_action = {url path='/admin/products/delete'} + form_content = {$smarty.capture.product_delete_dialog nofilter} + } {/block} {block name="javascript-initialization"} @@ -290,6 +471,11 @@ $('#category_delete_id').val($(this).data('id')); }); + // Set proper product ID in delete from + $('a.product-delete').click(function(ev) { + $('#product_delete_id').val($(this).data('id')); + }); + // JS stuff for creation form {include file = "includes/generic-js-dialog.html"