{"id":81,"date":"2024-10-07T19:21:21","date_gmt":"2024-10-07T10:21:21","guid":{"rendered":"https:\/\/memo-log.net\/?p=81"},"modified":"2024-11-01T19:49:50","modified_gmt":"2024-11-01T10:49:50","slug":"%e5%88%b0%e7%9d%80%e5%b8%8c%e6%9c%9b%e6%97%a5%e9%81%b8%e6%8a%9e%e3%83%aa%e3%82%b9%e3%83%88%e3%81%ab%e6%9b%9c%e6%97%a5%e3%82%92%e5%85%a5%e3%82%8c%e3%82%8b","status":"publish","type":"post","link":"https:\/\/memo-log.net\/?p=81","title":{"rendered":"welcart\u5230\u7740\u5e0c\u671b\u65e5\u9078\u629e\u30ea\u30b9\u30c8\u306b\u66dc\u65e5\u3092\u5165\u308c\u308b"},"content":{"rendered":"\n<p>welcart\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u5230\u7740\u5e0c\u671b\u65e5\u9078\u629e\u30ea\u30b9\u30c8\uff08select option\uff09\u306b\u66dc\u65e5\u304c\u8868\u793a\u3055\u308c\u306a\u3044\u3002<br>\u6ce8\u6587\u8005\u306b\u3068\u3063\u3066\u4e0d\u4fbf\u306a\u306e\u3067\u3001\u65e5\u4ed8\u306e\u5f8c\u308d\u306b\u66dc\u65e5\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-php\" data-lang=\"PHP\"><code>\/**\n * welcart ver2.10.5\n * hook\u304c\u3042\u308bfile : usc-e-shop\/includes\/delivery_info_script.php\n * \n * @param string $delivery_after_days_script\n *\/\nadd_filter( &#39;usces_delivery_after_days_script&#39;, function( $delivery_after_days_script ) {\n\t$no_preference = __( &#39;No preference&#39;, &#39;usces&#39; );\n\n\t$delivery_after_days_script = &quot;\n\tconst dayOfWeek_arr = [ &#39;(\u65e5)&#39;, &#39;(\u6708)&#39;, &#39;(\u706b)&#39;, &#39;(\u6c34)&#39;, &#39;(\u6728)&#39;, &#39;(\u91d1)&#39;, &#39;(\u571f)&#39; ];\n\tlet d_obj;\n\toption += &#39;&lt;option value=\\&quot;&quot; . $no_preference . &quot;\\&quot;&gt;&quot; . $no_preference . &quot;&lt;\/option&gt;&#39;;\n\tfor( var i = 0; i &lt; delivery_after_days; i++ ) {\n\t\td_obj = new Date( date[&#39;year&#39;], date[&#39;month&#39;] - 1, date[&#39;day&#39;] );\n\t\tdate_str = date[\\&quot;year\\&quot;] + \\&quot;-\\&quot; + date[\\&quot;month\\&quot;] + \\&quot;-\\&quot; + date[\\&quot;day\\&quot;];\n\t\tif ( date_str == selected_delivery_date ) {\n\t\t\toption += &#39;&lt;option value=\\&quot;&#39; + date_str + &#39;\\&quot; selected&gt;&#39; + date_str + dayOfWeek_arr[ d_obj.getDay() ] + &#39;&lt;\/option&gt;&#39;;\n\t\t} else {\n\t\t\toption += &#39;&lt;option value=\\&quot;&#39; + date_str + &#39;\\&quot;&gt;&#39; + date_str + dayOfWeek_arr[ d_obj.getDay() ] + &#39;&lt;\/option&gt;&#39;;\n\t\t}\n\t\tdate = addDate( date[\\&quot;year\\&quot;], date[\\&quot;month\\&quot;], date[\\&quot;day\\&quot;], 1 );\n\t}&quot;;\n\n\treturn $delivery_after_days_script;\n} );<\/code><\/pre><\/div>\n\n\n\n<p>15\u884c\u76ee\u3001Date\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30fc\u306e\u5f15\u6570\u3067\u3001\u6708\u306e\u5f15\u6570\u3092\u300cdate[&#8216;month&#8217;] &#8211; 1\u300d\u3068\u3057\u3066\u3044\u308b\u3002\u6708\u306f1\uff5e12\u3067\u306f\u306a\u304f0\uff5e11\u306a\u306e\u3067\u3001-1\u3092\u5f15\u304d\u7b97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u305f\u3081\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">option[value]\u306e\u5024\u306b\u66dc\u65e5\u306f\u5165\u308c\u306a\u3044\u3002<\/h2>\n\n\n\n<p>\u66dc\u65e5\u3092\u5165\u308c\u308b\u306e\u306foption\u306etextContent\u3060\u3051\u306b\u3059\u308b\u3002option[value]\u306e\u5024\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e&#8217;Y-m-d&#8217;\u5f62\u5f0f\u306e\u307e\u307e\u306b\u3057\u3066\u304a\u304f\u3002<\/p>\n\n\n\n<p>\u5f8c\u304b\u3089\u5206\u304b\u3063\u305f\u306e\u3060\u304c\u3001\u3053\u3046\u3057\u306a\u3044\u3068\u6307\u5b9a\u3055\u308c\u305f\u5230\u7740\u5e0c\u671b\u65e5\u306b\u5bfe\u3057\u3066\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u306a\u3044\u3002<\/p>\n\n\n\n<p>welcart\u306f\u3001\u5185\u5bb9\u78ba\u8a8d\u30da\u30fc\u30b8\u3078\u9077\u79fb\u3059\u308b\u969b\u306b\u3001\u300c\u6307\u5b9a\u3055\u308c\u305f\u5230\u7740\u5e0c\u671b\u65e5\u306b\u5546\u54c1\u304c\u5c4a\u304f\u306e\u304b\uff1f\u300d\u3092\u691c\u8a3c\u3057\u3066\u3044\u308b( $usces->delivery_check() \u2190 $usces->confirm() )\u3002<br>\u5177\u4f53\u7684\u306b\u306f\u3001\u5230\u7740\u5e0c\u671b\u65e5\u304c\u8a08\u7b97\u4e0a\u306e\u5230\u7740\u65e5(\uff1d\u767a\u9001\u4e88\u5b9a\u65e5\uff0b\u914d\u9054\u65e5\u6570)\u3088\u308a\u524d\u306a\u3089\u3001\u5230\u7740\u5e0c\u671b\u65e5\u306e\u518d\u6307\u5b9a\u3092\u5f37\u5236\u3059\u308b\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u3001\u5185\u5bb9\u78ba\u8a8d\u30da\u30fc\u30b8\u3078\u9077\u79fb\u3067\u304d\u306a\u3044\u3002<\/p>\n\n\n\n<p>\u5230\u7740\u5e0c\u671b\u65e5\u306e\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u3001\u307e\u305a\u3001\u5024\u306e\u5b58\u5728\u3092empty()\u3067\u78ba\u8a8d\u3057\u3001\u6b21\u306b\u3001\u65e5\u4ed8\u306e\u6b63\u5f53\u6027\u3092<a href=\"https:\/\/www.php.net\/manual\/ja\/function.checkdate.php\" target=\"_blank\" rel=\"noreferrer noopener\">checkdate()\u95a2\u6570<\/a>\u3067\u691c\u8a3c\u3057\u3066\u3044\u308b\u3002<br>\uff08\u6b63\u78ba\u306b\u3044\u3046\u3068\u3001usces_is_date()\u3068\u3044\u3046welcart\u72ec\u81ea\u306echeckdate()\u30e9\u30c3\u30d1\u30fc\u95a2\u6570\u3067\u691c\u8a3c\uff09<br>\u691c\u8a3c\u3059\u308b\u5024\u306f\u5f53\u7136\u3001POST\u9001\u4fe1\u3055\u308c\u308boption[value]\u5024\u3067\u3042\u308b\u3002\u3053\u3053\u306b\u65e5\u672c\u8a9e\u306e\u66dc\u65e5\u304c\u5165\u3063\u3066\u3044\u308b\u3068\u6b63\u5f53\u306a\u65e5\u4ed8\u3068\u307f\u306a\u3055\u308c\u305a\u3001\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u304c\u5b9f\u884c\u3055\u308c\u306a\u3044\u3002<\/p>\n\n\n\n<p>\u3057\u305f\u304c\u3063\u3066\u3001\u66dc\u65e5\u3092\u5165\u308c\u308b\u306e\u306foption\u306etextContent\u3060\u3051\u306b\u3057\u3066\u304a\u304f\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>welcart\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u306f\u3001\u5230\u7740\u5e0c\u671b\u65e5\u9078\u629e\u30ea\u30b9\u30c8\uff08select option\uff09\u306b\u66dc\u65e5\u304c\u8868\u793a\u3055\u308c\u306a\u3044\u3002\u6ce8\u6587\u8005\u306b\u3068\u3063\u3066\u4e0d\u4fbf\u306a\u306e\u3067\u3001\u65e5\u4ed8\u306e\u5f8c\u308d\u306b\u66dc\u65e5\u3092\u8ffd\u52a0\u3059\u308b\u3002 15\u884c\u76ee\u3001Date\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30fc\u306e\u5f15\u6570\u3067\u3001\u6708 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5],"class_list":["post-81","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-welcart"],"_links":{"self":[{"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/posts\/81","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/memo-log.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=81"}],"version-history":[{"count":0,"href":"https:\/\/memo-log.net\/index.php?rest_route=\/wp\/v2\/posts\/81\/revisions"}],"wp:attachment":[{"href":"https:\/\/memo-log.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=81"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/memo-log.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=81"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/memo-log.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=81"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}