Jump to content

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

Date Option MOD Rate Topic   - - - - -

 
  • quaxinvn
  • Junior Member
  • Members
  • Join Date: 22-Feb 11
  • 16 posts

Posted 14 March 2011 - 07:24 PM #41

I have modified Triplet's code according to my requirement to display only future dates above (attached date.zip). To give you an idea, I also attached a screenshot of the result (Date.jpg).

In product_options.tpl, I input the feature value like this:
{elseif $po.option_type == "D"} {*Date*}
{include file="date.tpl"}
<input id="option_{$id}_{$po.option_id}" type="text" readonly name="{$name}[{$id}][product_options][{$po.option_id}]" onclick="displayDatePicker('{$name}[{$id}][product_options][{$po.option_id}]','','','',{$product.product_features[10].value_int});" value="{$po.value|default:$po.inner_hint}" {if $product.exclude_from_calculate && !$product.aoc}disabled="disabled"{/if} {if !$no_script}onkeypress="cart_changed = true;"{/if} class="valign input-text {if $po.inner_hint && $po.value == ""}cm-hint{/if}" style="width:150px"/>

I figured out how to input feature value thanks to this thread: http://forum.cs-cart...ead.php?t=22933. To enable debugging go to Administrator>Setting>General>Check 'Template debugging console '.

Attached Thumbnails

  • Date.jpg

Attached Files

  • Attached File  date.zip   8.11KB   137 downloads


 
  • quaxinvn
  • Junior Member
  • Members
  • Join Date: 22-Feb 11
  • 16 posts

Posted 14 March 2011 - 09:38 PM #42

Do you know what is problem. I added your given files and i see the calendar, but after i made purche on the invoice i can't see date . do you know how to solve this problem?


To show date option on invoice. Modify '/www/skins/your_skin/mail/common_templates/options_info.tpl'

Old:
{foreach from=$product_options item=po name=po_opt}
{$po.option_name}: {$po.variant_name}

New:
{foreach from=$product_options item=po name=po_opt}
{if $po.variants}
{assign var="var" value=$po.variants[$po.value]}
{else}
{assign var="var" value=$po}
{/if}

{$po.option_name}: {if !$product.extra.custom_files[$po.option_id]}{$var.variant_name|default:$var.value}{/if}

 
  • SH
  • Member
  • Members
  • Join Date: 03-Mar 06
  • 47 posts

Posted 14 March 2011 - 10:26 PM #43

Been trying to get this MOD to work on the latest verion 2.1.4 Community to no avail. I'd really like to get it you work would anyone be able to post the 3 files - date.tpl, product_options.tpl and option-types.tpl for me, please

 
  • ali
  • Newbie
  • Members
  • Join Date: 06-Apr 12
  • 2 posts

Posted 06 April 2012 - 10:33 PM #44

I have never use community edition but i am sure the files are similar. i use cs cart professional and i needed a product option as date input. As we know cs cart is using jquery ui which already have date picker and for profile fields that's what cs cart is using. So i analyze that how cs cart can display a calendar without to much changes. i just took 3 steps
1. i create an input option for the product in admin.
2.in database i went to the table cscart_product_options i could see the option i created have option_type "I" i changed it to "D"
3.i went to skins/myselectskin/customer/views/products/components/product_options.tpl and at the end of the file i replaced

{elseif $po.option_type == "F"} {*File*}

<div class="clear">

{include file="common_templates/calendar.tpl" date_id="`$id_prefix`elm_`$field.field_id`" date_name="`$data_name`[`$data_id`]" date_val=$value start_year="1902" end_year="0"}


with


{elseif $po.option_type == "D"} {*File*}

<div class="clear">

{include file="common_templates/calendar.tpl" date_id="`$id_prefix`elm_`$field.field_id`" date_name="`$data_name`[`$data_id`]" date_val=$value start_year="1902" end_year="0"}


that's all it takes to do it. Now i can see calendar on my product option



 
  • raganello
  • Member
  • Members
  • Join Date: 19-Dec 12
  • 30 posts

Posted 27 March 2013 - 10:29 AM #45

Did anybody made possibile to have the datapicker option cs cart 3 ultimate?