We understand that your ecommerce site is crucial to the success of your business, from time to time issues and questions can arise and you need to have the assurance there will be someone on hand to help resolve these in a timely fashion so you can spend your time driving your own business forward.

So if you are looking for faster responses to your questions or would like the assurance there is someone on hand for you to contact, fear not we have a number of paid support options that are available to you that can give your organisation the peace of mind knowing a member from the Cart Viper team will always be available to assist!

Purchase a Support Plan

Community Support

HomeHomeIssues and Supp...Issues and Supp...Templates & UITemplates & UICart Viper Product WidgetCart Viper Product Widget
Previous
 
Next
New Post
8/30/2017 10:16 AM
 
Hello,
I set the module with:
Query Type new items

But I have a problem because the latest product is dated 2017-07-05 14: 54: 48.067 and then the widget remains empty.

The customer has seasonal products so it can happen that between publishing a product and another passes a long time.
The goal is to always have the latest products (eg last 3) inserted for a given category.

I've also tried Product Category but it is sorted by asc, so it's still not correct.


 
New Post
8/31/2017 11:10 AM
 
Hi,

That query type selects products created within the last 30 days, what you could do is alter the stored procedure that loads these products to use a greater time period than 30 days. If you go to host -> sql and execute the below query it should increase the time period to 5 months, i've highlighted the two sections in bold if you want to increase / decrease this period. Note you will need to go to host -> host settings and clear the sites cache after running this SQL:

ALTER procedure [dbo].[CVStore_GetAllProductCreatedAfterDate]
(
@portalId int,
@dateCreated datetime,
@categoryid int
)
as

set nocount on

if @categoryid <> -1
BEGIN
select p.* from dbo.[CVStore_Products] as p
inner join dbo.[CVStore_CategoryProduct] as cp
on p.productId = cp.productId
where portalId = @portalId and createddate > DATEADD(month, -5, GETDATE())
and cp.categoryId = @categoryId and displayInStore = 1
and p.isDeleted = 0
order by CreatedDate desc
END
ELSE
begin
select p.* from dbo.[CVStore_Products] as p
where portalId = @portalId and createddate > DATEADD(month, -5, GETDATE()) and displayInStore = 1 and p.isDeleted = 0
order by CreatedDate desc
END
 
New Post
8/31/2017 11:43 AM
 
hi,
Ok so it works, do you see any problem if I remove from where the date control?
 
New Post
8/31/2017 1:21 PM
 
If you remove the date filter from the where clause you will end up selecting the entire product catalog, if you're only wanting to show a few products it seems an expensive query. I would suggest further modifying to add a select top 

https://www.w3schools.com/sql/sql_top.asp
 
New Post
8/31/2017 1:36 PM
 
Ok, I've chosen the following solution:
1) If I have the result the operation is yours (no modification)
2) If I have no results, I take the top 10 (parameter in) without test date. Can I also be useful to you for future developments?

/****** Object:  StoredProcedure [dbo].[CVStore_GetAllProductCreatedAfterDate]    Script Date: 08/31/2017 12:37:04 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER procedure [dbo].[CVStore_GetAllProductCreatedAfterDate]
(
@portalId int,
@dateCreated datetime,
@categoryid int
--,@nTop int = 10 --I think it is more correct as an optional parameter, but it goes wrong so I declare it internally
)
as

set nocount on

declare @nitem int = 0
declare @nTop int = 10
if @categoryid <> -1
BEGIN

select @nitem = COUNT(*) from dbo.[CVStore_Products] as p
inner join dbo.[CVStore_CategoryProduct] as cp
on p.productId = cp.productId
where portalId = @portalId and createddate > @dateCreated

and cp.categoryId = @categoryId and displayInStore = 1
and p.isDeleted = 0

if @nitem <> 0
BEGIN
select p.* from dbo.[CVStore_Products] as p
inner join dbo.[CVStore_CategoryProduct] as cp
on p.productId = cp.productId
where portalId = @portalId and createddate > @dateCreated
and cp.categoryId = @categoryId and displayInStore = 1
and p.isDeleted = 0
order by CreatedDate desc
end
else 
begin 
select top(@nTop) p.* from dbo.[CVStore_Products] as p
inner join dbo.[CVStore_CategoryProduct] as cp
on p.productId = cp.productId
where portalId = @portalId --and createddate > @dateCreated
--and createddate > DATEADD(month, -6, GETDATE())
and cp.categoryId = @categoryId and displayInStore = 1
and p.isDeleted = 0
order by CreatedDate desc
end



END
ELSE
begin

select @nitem = COUNT(*) from dbo.[CVStore_Products] as p
where portalId = @portalId and createddate > @dateCreated 
and displayInStore = 1 and p.isDeleted = 0

if  @nitem <> 0
begin
select p.* from dbo.[CVStore_Products] as p
where portalId = @portalId and createddate > @dateCreated 
and displayInStore = 1 and p.isDeleted = 0
order by CreatedDate desc
end
else
begin
select top(@nTop) p.* from dbo.[CVStore_Products] as p
where portalId = @portalId --and createddate > @dateCreated
--and createddate > DATEADD(month, -6, GETDATE()) 
and displayInStore = 1 and p.isDeleted = 0
order by CreatedDate desc
end
END
 
Previous
 
Next
HomeHomeIssues and Supp...Issues and Supp...Templates & UITemplates & UICart Viper Product WidgetCart Viper Product Widget


 

We use cookies on our website to improve our service to you, by continuing you agree to our use of cookies. However you are able to update your settings at any time.

Cookie Policy

A cookie, also known as an HTTP cookie, web cookie, or browser cookie, is a piece of data stored by a website within a browser, and then subsequently sent back to the same website by the browser. Cookies were designed to be a reliable mechanism for websites to remember things that a browser had done there in the past, which can include having clicked particular buttons, logging in, or having read pages on that site months or years ago.

Strictly Necessary Cookies

These cookies cannot be disabled

These cookies are necessary for the website to function and cannot be switched off. They are normally set in response to your interactions on the website e.g. logging in etc.

Cookies:
  • .ASPXANONYMOUS
  • .DOTNETNUKE
  • __RequestVerificationToken
  • authentication
  • CV_Portal
  • CV_Store_Portal_Cart_0
  • CV_USER
  • dnn_IsMobile
  • language
  • LastPageId
  • NADevGDPRCookieConsent_portal_0
  • userBrowsingCookie

Performance Cookies

These cookies allow us to monitor traffic to our website so we can improve the performance and content of our site. They help us to know which pages are the most and least popular and see how visitors move around the site. All information these cookies collect is aggregated and therefore anonymous. If you do not allow these cookies we will not know when you have visited or how you navigated around our website.

Cookies:
  • _ga
  • _gat
  • _gid

Functional Cookies

These cookies enable the website to provide enhanced functionality and content. They may be set by the website or by third party providers whose services we have added to our pages. If you do not allow these cookies then some or all of these services may not function properly.

Cookies:

Currently we are not utilizing these types of cookies on our site.

Targeting Cookies

These cookies may be set through our site by our advertising partners. They may be used by those companies to build a profile of your interests and show you relevant adverts on other sites. They do not store directly personal information, but are based on uniquely identifying your browser and internet device. If you do not allow these cookies, you will experience less targeted advertising.

Cookies:

Currently we are not utilizing these types of cookies on our site.

Feedback