ماذا يفعل Calendar.js؟
-
13-12-2019 - |
سؤال
أحاول قطع بعض التعليمات البرمجية لتسريع الموقع ووجدت aclendar.phtml + js وأتساءل فقط، ماذا يفعلون؟
لا تحتوي الصفحة الرئيسية لموقعي على أي رمز تقويم، ولكن إذا كنت تريد فتح صفحات داخلية، مثل https://www.airyhair.com/tape-in-hair-extensions.html
لديها هذا:
'DHTML Date/Time Selector\n' +
"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" +
'For latest version visit: http://www.dynarch.com/projects/calendar/\n' +
'Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details.' +
'\n\n' +
'Date selection:\n' +
'- Use the \xab, \xbb buttons to select year\n' +
'- Use the \u2039 buttons to select month\n' +
'- Hold mouse button on any of the above buttons for faster selection.';
Calendar._TT["ABOUT_TIME"] = '\n\n' +
'Time selection:\n' +
'- Click on any of the time parts to increase it\n' +
'- or Shift-click to decrease it\n' +
'- or click and drag for faster selection.';
Calendar._TT["PREV_YEAR"] = 'Prev. year (hold for menu)';
Calendar._TT["PREV_MONTH"] = 'Prev. month (hold for menu)';
Calendar._TT["GO_TODAY"] = 'Go Today';
Calendar._TT["NEXT_MONTH"] = 'Next month (hold for menu)';
Calendar._TT["NEXT_YEAR"] = 'Next year (hold for menu)';
Calendar._TT["SEL_DATE"] = 'Select date';
Calendar._TT["DRAG_TO_MOVE"] = 'Drag to move';
Calendar._TT["PART_TODAY"] = ' (' + "today" + ')';
// the following is to inform that "%s" is to be the first day of week
Calendar._TT["DAY_FIRST"] = 'Display %s first';
// This may be locale-dependent. It specifies the week-end days, as an array
// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1
// means Monday, etc.
Calendar._TT["WEEKEND"] = "0,6";
Calendar._TT["CLOSE"] = 'Close';
Calendar._TT["TODAY"] = "today";
Calendar._TT["TIME_PART"] = '(Shift-)Click or drag to change value';
// date formats
Calendar._TT["DEF_DATE_FORMAT"] = "%b %e, %Y";
Calendar._TT["TT_DATE_FORMAT"] = "%B %e, %Y";
Calendar._TT["WK"] = "Week";
Calendar._TT["TIME"] = 'Time:';
//]]>
هل هذا مطلوب لمنتجات التجزئة؟لم يسبق لي أن رأيت تقويمًا على موقعي
المحلول
يتم استخدام Calendar.js لإدخال التاريخ لخيارات المنتج المخصصة (أثناء إنشاء المنتج في منتج إضافة/تحرير المسؤول)
لإزالة ملف CSS من رأسك في صفحة تفاصيل المنتج (بافتراض أنه ليس لديك أي سمة منتج مخصصة من نوع إدخال التاريخ).
نلقي نظرة على catalog_product_view
/app/design/frontend/base/default/layout/catalog.xml
في ملف local.xml الخاص بك
<catalog_product_view>
<reference name="head">
<action method="removeItem"><type>skin_css</type><name>calendar/calendar-win2k-1.css</name></action>
.....
يرى يقوم Magento بإزالة CSS أو JS من عرض محدد
لإزالة الكود من الصفحة
<catalog_product_view>
<reference name="product_options_wrapper">
<action method="unsetChild"><name>html_calendar</name></action>
</reference>
</catalog_product_view>
لا تنتمي إلى magento.stackexchange