Home  >  Forums  >  General  >  General Support  >  Popular Tags

Popular Tags

Posted: 3 years ago Quote #33678
Not sure if this is relevant here but if you want to use the tags feature without the hassle of manually maintaining them here is a straight forward SQL scrip I wrote to help expedite the process. I use this all the time hope you find it useful as well (Site reference www.bijoudiva.com V8.0).

--Start of script
--Your tags...
select 'abalone' tag_name into #nop_tag_build
union  
select 'charm'
union  
select 'chunky'
union  
select 'designer'
union  
select 'fashionable'
union  
select 'floral'
union  
select 'gorgeous'
union  
select 'hammered'
union  
select 'stones'
union  
select 'stretch'  


declare @tag_name varchar(50)
declare nop_tag_update cursor for
select
  tag_name
from
  #nop_tag_build
open nop_tag_update
fetch next from nop_tag_update
into @tag_name
while @@fetch_status = 0
begin

  delete nop_producttag where name = @tag_name
  declare @producttagid int, @rowcount int

  insert into nop_producttag(name, productcount)
  values (@tag_name, 1)

  set @producttagid = @@identity

  insert into nop_producttag_product_mapping (producttagid, productid)
  select @producttagid, productid
  from nop_product
  where fulldescription like '%'+@tag_name+'%' and deleted = 0

  update nop_producttag
  set productcount = @@rowcount
  where producttagid = @producttagid
  
  fetch next from nop_tag_update
  into @tag_name
end
close nop_tag_update
deallocate nop_tag_update
go
drop table #nop_tag_build
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: one year ago Quote #70370
danzik17 wrote:

<nopCommerce:PopularTags ID="ctrlPopularTags" runat="server" visible="false" />

That would work too, however if you don't want it displayed, why waste precious bandwidth loading controls that you aren't going to use?


If visible=false then it doesn't use any bandwidth :)   Invisible controls do not have any rendered HTML.
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
nopCommerce on facebook