Jump to content

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

Date Option MOD Rate Topic   - - - - -

 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 16 May 2010 - 09:53 PM #21

This worked for me


 
{if !$app_types || ($app_types && $app_types|strpos:"I" !== false)}
<option value="I" {if $value == "I"}selected="selected"{/if}>{$lang.text}</option>
{/if}
{if !$app_types || ($app_types && $app_types|strpos:"D" !== false)}
<option value="D" {if $value == "D"}selected="selected"{/if}>Date</option>
{/if}
{if !$app_types || ($app_types && $app_types|strpos:"T" !== false)}
<option value="T" {if $value == "T"}selected="selected"{/if}>{$lang.textarea}</option>
{/if}
 

 
{elseif $po.option_type == "I"} {*Input*}
   <input id="option_{$id}_{$po.option_id}" type="text" name="{$name}[{$id}][product_options][{$po.option_id}]" 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}" />
 
 
{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}]" 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}" /><input type=button value="select" onclick="displayDatePicker('{$name}[{$id}][product_options][{$po.option_id}]');">
 
 
 
    {elseif $po.option_type == "T"} {*Textarea*}
 

Placed date.tpl (as listed in original post) in yourskin\customer directory

 
  • gugga7
  • Senior Member
  • Members
  • Join Date: 16-Mar 08
  • 277 posts

Posted 16 May 2010 - 10:18 PM #22

Damn, I know I'm so close to this...

I placed date.tpl under \skins\basic\customer\ and I changed the lines order like shown above but it still messes up the product page.

Attached are the files I modified.

Attached Files



 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 16 May 2010 - 11:27 PM #23

Enclosed are my files. It is from 2.0.12

Attached Files

  • Attached File  date.zip   15.57KB   129 downloads


 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 16 May 2010 - 11:32 PM #24

Enclosed are my files. It is from 2.0.12, but I imagine the mods should work in any 2.0x version.

Attached Files

  • Attached File  date.zip   8.01KB   176 downloads


 
  • fuelishways
  • Junior Member
  • Members
  • Join Date: 09-May 10
  • 13 posts

Posted 17 May 2010 - 04:29 AM #25

Triplets, I finally got this to work! Now one other thing, is it possible to make the field a required field?
Submit reviews of medical marijuana dispensaries and chat with other medical marijuana patients
http://www.mymarijuananetwork.com

 
  • gugga7
  • Senior Member
  • Members
  • Join Date: 16-Mar 08
  • 277 posts

Posted 17 May 2010 - 06:34 AM #26

Fuelishways,

so what was the issue?

 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 17 May 2010 - 11:34 AM #27

Read through my mod at http://forum.cs-cart...hlight=required

This was for making a Select Box Required, but it should be easy to modify it for the Date Field.

 
  • fuelishways
  • Junior Member
  • Members
  • Join Date: 09-May 10
  • 13 posts

Posted 17 May 2010 - 02:32 PM #28

so what was the issue?


Main issue is that I'm an idiot. But, I didn't realize in your first post to me that the "&cc" actually meant something. I was clearing my cache in my browser.

Thanks for all your help. It's great that you readily post such a great MOD.
Submit reviews of medical marijuana dispensaries and chat with other medical marijuana patients
http://www.mymarijuananetwork.com

 
  • gugga7
  • Senior Member
  • Members
  • Join Date: 16-Mar 08
  • 277 posts

Posted 17 May 2010 - 03:37 PM #29

Hi Triplets, I'm not sure why it's not working for me, I added the codes exactly as mentioned above. Do you think the calendar might be in conflict with another script? I have the "addthis" social script on the Product page...

Can you please check the files I posted above in the thread and let me know if you see something wrong in them? That will help me research the issue.

Thanks!

 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 17 May 2010 - 03:48 PM #30

It looks like you are missing a whole bunch of code. It appears you deleted the TextArea block code when you added the mod. Go back and do a file compare from mine to yours and you will see the code missing.
.

 
  • gugga7
  • Senior Member
  • Members
  • Join Date: 16-Mar 08
  • 277 posts

Posted 17 May 2010 - 08:04 PM #31

Great, It worked ! Thank you!

Any idea how to shorten the Date field in the frontend? (see screenchot)

Also, I want to replace the "Select" button by an Calendar Icon, can you point me where I can do this in the code?

Thanks again.

Attached Thumbnails

  • date.JPG


 
  • Triplets
  • Senior Member
  • Members
  • Join Date: 23-Sep 08
  • 1179 posts

Posted 17 May 2010 - 08:25 PM #32

You can change the field length and button on this line

<input id="option_{$id}_{$po.option_id}" type="text" readonly name="{$name}[{$id}][product_options][{$po.option_id}]" 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}" /><input type=button value="select" onclick="displayDatePicker('{$name}[{$id}][product_options][{$po.option_id}]');">

Just use regular html and css syntax.

 
  • gugga7
  • Senior Member
  • Members
  • Join Date: 16-Mar 08
  • 277 posts

Posted 17 May 2010 - 09:03 PM #33

Here is what I changed::

<[B]input type="image" src="images/icons/calendar.gif" [/B]onclick="displayDatePicker('{$name}[{$id}][product_options][{$po.option_id}]');">

The icon shows correctly but when I click on it, it gives me a 404 error. Do you think that the onclick command might not work with <input type="image"... ?

Also, should I add a WIDTH value somewhere? If that's the case, where should I add it in the code?

Thanks guys for being patient.

 
  • grabbags
  • Senior Member
  • Members
  • Join Date: 14-Aug 07
  • 360 posts

Posted 18 June 2010 - 06:25 PM #34

I need a mod like this. Thank you!

 
  • grabbags
  • Senior Member
  • Members
  • Join Date: 14-Aug 07
  • 360 posts

Posted 19 June 2010 - 07:24 PM #35

Triplets, I finally got this to work! Now one other thing, is it possible to make the field a required field?


Did you make this as a required field? Do you mind to share please? Thank you!

 
  • simalam
  • Junior Member
  • Members
  • Join Date: 03-Jun 09
  • 4 posts

Posted 23 July 2010 - 01:49 PM #36

David, thanks for being a proponent of open source. I'm wondering if it's possible to use similar logic to have certain buttons appear and disappear based on a user's membership or location.

Is that possible?

Thanks,
Adam

 
  • Lee Li Pop
  • Senior Member
  • Members
  • Join Date: 07-Mar 08
  • 941 posts

Posted 24 August 2010 - 03:29 PM #37

Hello Triplets,

First of all, thank you so much for this mod.

I use CSC 1.3.5, and have three issues:

1 - I don't understand your code in product_options.tpl:

{include file="templates/`$product.product_code`.tpl"}

So, I removed it, because I have no templates directory.

2 - The date selected by customer is not saved, and I cannot see it on back office or in email. (The biggest issue...)

3 - I can select a past date than today.

Thank you for your help,


Lee Li Pop
.
If All Else Fails, Read The Instruction Manual! Knowledge Base 2.x + CS-Cart Instruction Manual

Hosted at Pair.com since 2000. Zero hacking attempts during first 11 years... And counting!

 
  • Lee Li Pop
  • Senior Member
  • Members
  • Join Date: 07-Mar 08
  • 941 posts

Posted 25 August 2010 - 11:47 AM #38

Hello All,

Well, same issues... It's unstable, sometime, date is showing, the next order, date is out :(

First of all, there are thousand "Booking and/or Reservations" solutions. Some are very expensive or on the other hand very limited. Some are stand alone, some are hosted solutions (as "web appointment" solutions).

Here are the best solutions in my case what I found:

1 - The best Booking and Reservations (expert, event, hotel, etc...) in my opinion based on Magento:

$299 + $50 for install: $349.

Explanation:

http://ecommerce.ahe...servations.html

Demo page:

http://demo.aheadwor...servations.html

Here is the only back office image available, because, you have no access to back office demo:

Posted Image

BECAREFUL! It's running with Magento! As everybody knows, Magento needs a powerful hosting conditions to runs smoothly!



2 - On Joomla there are Appointment Booking Pro (ABPro) and Resource Booking Pro (RBPro):

$49 US with one (1) year access for downloading updates and patches.

$99 US with lifetime access for downloading updates and patches.


http://www.svhost1.com/abpro_demos/

Demo page (Admin demo is test / test):

http://svhost6.com/u...n GAD&Itemid=53



3 - For restaurant with a good SEO level:

$190 (SPECIAL PRICE $140)

http://www.web-restaurants.com/

Demo page:

http://www.web-resta...s.com/demo.html



Lee Li Pop
.
If All Else Fails, Read The Instruction Manual! Knowledge Base 2.x + CS-Cart Instruction Manual

Hosted at Pair.com since 2000. Zero hacking attempts during first 11 years... And counting!

 
  • spiglys
  • Junior Member
  • Members
  • Join Date: 11-Dec 10
  • 1 posts

Posted 12 December 2010 - 03:17 AM #39

Enclosed are my files. It is from 2.0.12, but I imagine the mods should work in any 2.0x version.


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?

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

Posted 10 March 2011 - 05:35 PM #40

I have modified Triplets' code to enable only future dates according to a feature (date.zip). To give you an idea, I attached a screenshot (date.jpg).

In product_options.tpl, I input 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 learnt how to input feature value thanks to this thread: http://forum.cs-cart...ead.php?t=22933. To enable debugging, Administration>Setting>General> Check 'Template debugging console'

Attached Thumbnails

  • Date.jpg

Attached Files

  • Attached File  date.zip   8.11KB   147 downloads