તમારા કાર્ટમાં ડિલિવરી ડેટ પિકર ઉમેરો
તમે તમારા કાર્ટ પેજ પર એક કૅલેન્ડર શામેલ કરી શકો છો, જે ગ્રાહકોને તેમના ઑર્ડર માટે ડિલિવરીની તારીખ નિર્દિષ્ટ કરવાની મંજૂરી આપે છે.

આ પેજ પર
તમારી theme.liquidમાં jQueryને શામેલ કરો
આ કસ્ટમાઇઝેશન કામ કરી શકે તે માટે, કેટલીક થીમ્સમાં આવશ્યક છે કે theme.liquid લેઆઉટ ફાઇલમાં jQuery માટે એક સ્ક્રિપ્ટ ટૅગ ઉમેરવામાં આવેલો હોય. જો તમે મફત Shopify થીમનો ઉપયોગ કરતા હો, તો તમારે આગલા પગલાને અનુસરવાની જરૂર પડી શકે છે:
લેઆઉટ ડિરેક્ટરીમાં,
theme.liquidપર ક્લિક કરો.કોડમાં બંધ થતા
</head>ટૅગને શોધો. બંધ થતા</head>ટૅગની ઉપરની એક નવી લાઇનમાં, નીચેનો કોડ પેસ્ટ કરો:
{{ '//ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js' | script_tag }}- સાચવો પર ક્લિક કરો.
એક ડિલિવરી તારીખનું સ્નિપેટ બનાવો
તમારા ડિલિવરી ડેટ પિકર માટે એક સ્નિપેટ બનાવવા માટે:
ડેસ્કટૉપ
તમારા Shopify ઍડમિનમાંથી, ઑનલાઇન સ્ટોર પર જાઓ.
તમે જે થીમમાં ફેરફાર કરવા માગો છો તે શોધો, ક્રિયાઓનું મેનૂ ખોલવા માટે
બટન પર ક્લિક કરો, અને પછી કોડમાં ફેરફાર કરો પર ક્લિક કરો.
સ્નિપેટ્સ ડિરેક્ટરીમાં, એક નવું સ્નિપેટ ઉમેરો પર ક્લિક કરો:
સ્નિપેટ બનાવો:
તમારા સ્નિપેટને
delivery-dateનામ આપો.સ્નિપેટ બનાવો પર ક્લિક કરો. નવી સ્નિપેટ ફાઇલ કોડ એડિટરમાં ખુલશે.
તમારા નવા
delivery-date.liquidસ્નિપેટમાં, નીચેનો કોડ પેસ્ટ કરો:
{{ '//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css' | stylesheet_tag }}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<div style="width:300px; clear:both;">
<p>
<label for="date">Pick a delivery date:</label>
<input id="date" type="text" name="attributes[date]" value="{{ cart.attributes.date }}" />
<span style="display:block" class="instructions"> We do not deliver during the weekend.</span>
</p>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
if (window.jQuery) {
$(function() {
$("#date").datepicker({
minDate: +1,
maxDate: '+2M',
beforeShowDay: $.datepicker.noWeekends
});
});
}
});
</script>
- સાચવો પર ક્લિક કરો.
મોબાઇલ
Shopify ઍપ માંથી,
આઇકન પર ટૅપ કરો.
વેચાણ ચૅનલ વિભાગમાં, ઑનલાઇન સ્ટોર પર ટૅપ કરો.
બધી થીમ મેનેજ કરો પર ટૅપ કરો.
તમે સંપાદિત કરવા માગતા હો તે થીમ શોધો, ઍક્શન મેનૂ ખોલવા માટે
બટન પર ટૅપ કરો અને પછી કોડ સંપાદિત કરો પર ટૅપ કરો.
Snippets ડિરેક્ટરીમાં, નવું સ્નિપેટ ઉમેરો પર ટૅપ કરો:
સ્નિપેટ બનાવો:
તમારા સ્નિપેટને
delivery-dateનામ આપો.સ્નિપેટ બનાવો પર ટૅપ કરો. કોડ એડિટરમાં નવી સ્નિપેટ ફાઇલ ખુલશે.
તમારા નવા
delivery-date.liquidસ્નિપેટમાં, નીચેનો કોડ પેસ્ટ કરો:
{{ '//code.jquery.com/ui/1.9.2/themes/base/jquery-ui.css' | stylesheet_tag }}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.3/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js"></script>
<div style="width:300px; clear:both;">
<p>
<label for="date">Pick a delivery date:</label>
<input id="date" type="text" name="attributes[date]" value="{{ cart.attributes.date }}" />
<span style="display:block" class="instructions"> We do not deliver during the weekend.</span>
</p>
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
if (window.jQuery) {
$(function() {
$("#date").datepicker({
minDate: +1,
maxDate: '+2M',
beforeShowDay: $.datepicker.noWeekends
});
});
}
});
</script>
- સાચવો પર ટૅપ કરો.
તમારા કાર્ટ પેજમાં સ્નિપેટ શામેલ કરો
તમારા કાર્ટ પેજમાં ડિલિવરી તારીખનું સ્નિપેટ શામેલ કરવા માટે:
Sections ડિરેક્ટરીમાં,
main-cart-items.liquidપર ક્લિક કરો.કોડમાં
</form>ક્લોઝિંગ ટૅગ શોધો.</form>ક્લોઝિંગ ટૅગની ઉપર નવી લાઇનમાં, નીચેનો કોડ પેસ્ટ કરો:
{% render 'delivery-date' %}- સાચવો પર ક્લિક કરો.
હવે તમારા કાર્ટ પેજ પર ડિલિવરી તારીખ ઇનપુટ માટેનું ફીલ્ડ છે. જ્યારે તમે ટેક્સ્ટ ફીલ્ડની અંદર ક્લિક કરશો, ત્યારે કૅલેન્ડર દેખાશે:

આ કસ્ટમાઇઝેશનમાં ઉપયોગમાં લેવાયેલ ડેટ પિકર jQuery UI library નું વિજેટ છે.