Tips and Tricks HQ Support Portal › Forums › WP eStore Forum › WP eStore General Questions › eStore – adding datepicker as a product variation?
- This topic has 11 replies, 3 voices, and was last updated 9 years, 5 months ago by wpCommerce.
-
AuthorPosts
-
June 23, 2015 at 1:22 pm #12793ZeOneNZeOnlyMember
I’m wondering how easy it would be to make a datepicker one of the product variations. Some of my products are rentals and it would be nice to have a way to pick a start and end date when they purchase rather than typing in the dates in a custom field. Is there a way I could insert code into a product variation field to make it a datepicker that would just put the date in for these selections?
I’ve been using a thank you page form to collect the dates, but not everyone does that after the purchase.
Does anyone have a solution for this?
WordPress version: 4.2.2
WP eStore version: 7.0.7
June 23, 2015 at 2:58 pm #70525wzpModeratorWhat you are asking is if there could be 2 date-picker variations; one for the start date, and one for the end date. Consequentially, each of these 2 “variations” could contain an infinite number of values (dates). The current design will not allow this; without an extensive overhaul of how the plugin conceptualizes variations.
June 23, 2015 at 5:49 pm #70526ZeOneNZeOnlyMemberWhat I’m thinking would be a way to just do this on the field..
I’m going to give this a shot and see if I can get this to work.
June 23, 2015 at 10:39 pm #70527ZeOneNZeOnlyMemberSo in eStore_button_display_helper.php
if($ret_product->custom_input == ‘1’)
{
if(!empty($ret_product->custom_input_label))
$var_output .= ‘<span class=”eStore_custom_input_name”>’.$ret_product->custom_input_label.’: </span><input id=”datepicker” type=”text” name=”custom_input” value=”” class=”eStore_text_input eStore_collect_input” />’;
else
$var_output .= ‘<span class=”eStore_custom_input_name”>Instructions: </span><input id=”datepicker” type=”text” name=”custom_input” value=”” class=”eStore_text_input eStore_collect_input” />’;
if ($line_break) $var_output .= ‘
‘;else $var_output .= ‘ ‘;
}
I added an ID in here, but it’s not showing up in the code. Is there another place where this is generated I’m missing?
June 23, 2015 at 11:52 pm #70528wpCommerceModerator@ZeOneNZeOnly, Which shortcode are you using?
June 24, 2015 at 1:07 am #70529ZeOneNZeOnlyMembernot using a shortcode, but I can apply the datepicker if I can make an ID on that input from above.
June 24, 2015 at 1:09 am #70530ZeOneNZeOnlyMemberI’m not using the custom input for anything else. I just need it to populate that jquery datepicker on that field and it will input the start date as if someone entered it in so it will be on the receipt/order
June 24, 2015 at 1:11 am #70531ZeOneNZeOnlyMember[wp_eStore_fancy1 id=25]
this is the shortcode on the page I’m using to test
[http://camprentalgear.com/testing-date-picker/]
June 24, 2015 at 8:13 pm #70532ZeOneNZeOnlyMemberanyone? I added the id to that code in the plugin and it’s not showing up
June 25, 2015 at 12:21 am #70533wpCommerceModeratorYou edited the correct file. But the code is not there. This is what I see when I view the page:
<span class="eStore_custom_input_name">Start Date: </span>
<input type="text" name="custom_input" value="" class="eStore_text_input eStore_collect_input">Did you update it via FTP?
June 25, 2015 at 3:49 am #70534ZeOneNZeOnlyMemberahhh I did it via ftp and it worked. I also just had to change
<script>
$(function() {
$( “#datepicker” ).datepicker();
});
</script>
<script>
jQuery(function() {
jQuery( “#datepicker” ).datepicker();
});
</script>
Sweet!!!!
Is there anyway I can modify like variation three to be an input field like this?
June 26, 2015 at 1:30 am #70535wpCommerceModeratorIt may not be possible since variation is not an input field.
-
AuthorPosts
- You must be logged in to reply to this topic.