Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Label "New" Rate Topic   - - - - -

 
  • mirnitagl
  • Senior Member
  • Members
  • Join Date: 19-Nov 06
  • 334 posts

Posted 27 April 2009 - 07:34 PM #21

yes, I did see the number of days in admin, I changed the 0 for 15 days and added a new product just to test it. No results.
I think some other mod may be interfering with this one, but well, it is not something I considered extremely necessary so I removed the code in the files where I placed it and that's it.
What really bothers me is not to be able to show the manufacturer name whenerver a product is listed in my store.
I tried this:
{if $product.manufacturer}
<div ><b>{$product.manufacturer}</b></div>
{/if}
and it works only in products_multicolumns.tpl but not in the rest of files.
That is more important for me than the new label. When it comes to home supplies people trust certain brands and look for them.

 
  • Eddy
  • Member
  • Members
  • Join Date: 08-Nov 07
  • 37 posts

Posted 19 June 2009 - 06:51 PM #22

I want default sort is added date for cs-cart 2.04

I mean, when I add the product to my store and it always display first (top of all others depends on the date)

Anyone can help?

 
  • Eddy
  • Member
  • Members
  • Join Date: 08-Nov 07
  • 37 posts

Posted 19 June 2009 - 07:29 PM #23

1. Add a language variable:

date_added = Newly listed

2. In "/include/common/search_products.php"

ADD THE PART IN RED BELOW

$sortings = array (
    'code' => 'products.product_code',
    'avail' => 'products.avail',
[COLOR=#ff0000]    'timestamp' => 'products.timestamp',[/COLOR]
    'product' => 'descr1.product',
    'position' => ($settings['General']['improved_product_search'] == 'Y') ? 'avail_products.position' : 'products_categories.position',
    'price' => 'prices.price',
    'list_price' => 'products.list_price',
    'weight' => 'products.weight',
    'amount' => 'products.amount'
);
3. In "/skins/CLIENT_SKIN/customer/product_pages/sorting.tpl"

ADD THE PART IN RED BELOW

<div align="right">
 <b>{$lang.sort_by}:</b>   
 [COLOR=red]<a class="underlined{if $sort_by == 'timestamp'}-bold{/if}" href="{$curl}&sort_by=product&amp;sort_order={if $sort_by == 'timestamp'}{$sort_order}{else}desc{/if}" {$onclick} rel="nofollow">{$lang.date_added}{if $sort_by == 'timestamp'}{if $sort_order == 'asc'}<img src="{$images_dir}/sort_desc.gif" width="13" height="7" border="0" alt="" style="margin-left: 5px;" />{else}<img src="{$images_dir}/sort_asc.gif" width="13" height="7" border="0" alt="" style="margin-left: 5px;" />{/if}{/if}</a>    [/COLOR]
 <a class="underlined{if $sort_by == 'product'}-bold{/if}" href="{$curl}&sort_by=product&amp;sort_order={if $sort_by == 'product'}{$sort_order}{else}asc{/if}" {$onclick} rel="nofollow">{$lang.product}{if $sort_by == 'product'}{if $sort_order == 'asc'}<img src="{$images_dir}/sort_desc.gif" width="13" height="7" border="0" alt="" style="margin-left: 5px;" />{else}<img src="{$images_dir}/sort_asc.gif" width="13" height="7" border="0" alt="" style="margin-left: 5px;" />{/if}{/if}</a>    
 <a class="underlined{if $sort_by == 'price'}-bold{/if}" href="{$curl}&sort_by=price&amp;sort_order={if $sort_by == 'price'}{$sort_order}{else}asc{/if}" {$onclick} rel="nofollow">{$lang.price}{if $sort_by == 'price'}{if $sort_order == 'asc'}<img src="{$images_dir}/sort_desc.gif" width="13" height="7" border="0" alt="" style="margin-left: 5px;" />{else}<img src="{$images_dir}/sort_asc.gif" width="13" height="7" border="0" alt="" style="margin-left: 5px;" />{/if}{/if}</a>    
 <a class="underlined{if $sort_by == 'position'}-bold{/if}" href="{$curl}&sort_by=position&amp;sort_order={if $sort_by == 'position'}{$sort_order}{else}asc{/if}" {$onclick} rel="nofollow">{$lang.default}</a>    
</div>


In the new version of CS 2.04, the sorting.tpl in /skins/your_skins/customer/views/products/components as follows:

<strong>{$lang.sort_by}:</strong>   
<a class="{if $search.sort_by == "product"}strong{/if} {$ajax_class}" rev="pagination_contents" href="{$curl}&sort_by=product&sort_order={if $search.sort_by == "product"}{$search.sort_order}{else}asc{/if}" rel="nofollow">{$lang.product}{if $search.sort_by == "product"} {if $search.sort_order == "asc"}<img src="{$images_dir}/icons/sort_desc.gif" width="7" height="6" border="0" alt="" />{else}<img src="{$images_dir}/icons/sort_asc.gif" width="7" height="6" border="0" alt="" />{/if}{/if}</a>    
<a class="{if $search.sort_by == "price"}strong{/if} {$ajax_class}" rev="pagination_contents" href="{$curl}&sort_by=price&sort_order={if $search.sort_by == "price"}{$search.sort_order}{else}asc{/if}" rel="nofollow">{$lang.price}{if $search.sort_by == "price"} {if $search.sort_order == "asc"}<img src="{$images_dir}/icons/sort_desc.gif" width="7" height="6" border="0" alt="" />{else}<img src="{$images_dir}/icons/sort_asc.gif" width="7" height="6" border="0" alt="" />{/if}{/if}</a>    
<a class="{if $search.sort_by == "position"}strong{/if} {$ajax_class}" rev="pagination_contents" href="{$curl}&sort_by=position&sort_order={if $search.sort_by == "position"}{$search.sort_order}{else}asc{/if}" rel="nofollow">{$lang.default}</a>    


How we can set sort default by added date (THe newly added will display on top?

 
  • cimtech
  • Member
  • Members
  • Join Date: 10-Jul 09
  • 83 posts

Posted 16 July 2009 - 12:46 AM #24

Did you set the number of days in Admin -> Settings -> "New" label period

The default is 0 which will not show any images.


Is this still a setting in 2.05? I can't seem to find it...

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3330 posts

Posted 22 July 2009 - 03:21 PM #25

Does this work on 2x?


I believe this trick should work. It did for me. Backup your original copies first though.

1. First put an image "new.gif" into the "skins/CLIENT_SKIN/customer/images" directory.

2. Run this SQL command on your database.

INSERT INTO `cscart_settings` (`option_id`,`option_name`,`section_id`,`subsection_id`,`option_type`,`value`,`position`,`is_global`) VALUES (1000000,'new_label_period','Appearance','','I','0',181,'Y');
INSERT INTO `cscart_settings_descriptions` (`object_id`,`description`,`object_type`,`lang_code`,`object_string_id`) VALUES (1000000,'\"New\" label period','O','EN','');
3. For the product_details.tpl and products.tpl/products_advanced.tpl/products_multicolumns.tpl files, add this code where you want the image to show up:

{php}
$new_period = $settings['Appearance']['new_label_period'];
$prod = $this->get_template_vars('product');
$dbd = max(0,date('U') - db_get_field('SELECT timestamp FROM cscart_products WHERE product_id = ' . $prod['product_id'] . ';')) / 86400;
if($new_period >= $dbd) {
    $this->assign('new','Y');
} else {
    $this->assign('new','N');
}
{/php}
{if $new == "Y"}
<img src="{$images_dir}/new.gif" style="vertical-align:middle;" />
{/if}
4. Set the number of days in Appearance Settings. 0 will make no "new" icons appear at all.



 
  • pbradish
  • Senior Member
  • Members
  • Join Date: 03-Apr 08
  • 119 posts

Posted 10 September 2009 - 08:36 PM #26

Great mod, thank you! :D
1.3.5

 
  • moro1
  • Junior Member
  • Members
  • Join Date: 04-Apr 10
  • 20 posts

Posted 17 March 2011 - 05:25 PM #27

Hi! I have followed instructions step by step, yet it is not working in my store.

:-(
same problem, cs-cart v. 2.1.2.

 
  • MimiWatch
  • Member
  • Members
  • Join Date: 14-Jun 08
  • 138 posts

Posted 06 February 2012 - 01:36 PM #28

I have tried to integrate this improvement into version 2.2.4 but it is not working. Does somebody have it resolved?

I would be grateful

 
  • Darius
  • Douchebag
  • Members
  • Join Date: 20-Apr 08
  • 3330 posts

Posted 06 February 2012 - 01:39 PM #29

Such features ar discussed for few years now but developers do not care to integrate them by default..