如何在Kentico 10中禁用产品? [英] How do I disable products in Kentico 10?

查看:293
本文介绍了如何在Kentico 10中禁用产品?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在对kentico 10中的电子商务网站的产品执行CRUD操作.我可以使用以下API添加和更新产品

I am performing CRUD operations for products of e-commerce site in kentico 10.I can add and update products using below API

SKUInfoProvider.SetSKUInfo(updateProduct);

还有一个用于删除产品的API

Also there is an API for deleting product

SKUInfoProvider.DeleteSKUInfo(updateProduct);

但是我不希望从数据库中删除该产品,而只是禁用它们,以使它们不会显示给最终用户而仍然留在数据库中.

But I do not wish to delete the product from database,rather just disable them so that they do not show up to the end users and still stay in the database .

这是产品的SKU对象:

This are the SKU Objects for the product :

var sku = new SKUInfo
            {
                //SKUName = Convert.ToString(dr["SHORT_DESCRIPTION"]).Trim('"') + " (" + Convert.ToString(dr["MANUFACTURER_PART_NUMBER"]) + ")",
                SKUName = Convert.ToString(dr["MANUFACTURER_PART_NUMBER"]),
                SKUDescription = Convert.ToString(dr["TECHNICAL_SPECIFICATIONS"]).Trim('"'),
                SKUShortDescription = Convert.ToString(dr["SHORT_DESCRIPTION"]).Trim('"'),
                SKUPrice = ValidationHelper.GetDouble(dr["RESELLER_BUY_INC"], 0),
                SKURetailPrice = ValidationHelper.GetDouble(dr["RRP_INC"], 0),
                SKUEnabled = true,
                SKUSiteID = siteId,
                SKUProductType = SKUProductTypeEnum.Product,
                SKUManufacturerID = manufacturer.ManufacturerID,
                SKUDepartmentID = department.DepartmentID,
                SKUHeight = 100,
                SKUWidth = 100,
                SKUAvailableItems = 1,
                SKUSellOnlyAvailable = true
            };

我试图将SKUEnabled设置为false,但是用户仍然可以看到该产品.那么,是否有任何属性可以禁用产品?

I tried to set SKUEnabled as false but still user can see the product.So, is there any property to disable products ?

推荐答案

您如何显示Sku?如果是中继器,则可能需要在where条件中按"SKUEnabled = 1"进行过滤.

How are you displaying the Sku? If it's a repeater, you may need to filter by the "SKUEnabled = 1" in your where condition.

另一个选择是,如果产品具有页面(不是独立的sku),则可以取消发布页面本身.

Another option is if the Product has a Page (it's not a stand alone sku) you can unpublish the page itself.

这篇关于如何在Kentico 10中禁用产品?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆