This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{# Product/detail.twig #} | |
{% block javascript %} | |
<script> | |
(function(){ | |
// <input>を<select>に書き換え | |
$('#quantity').replaceWith('<select id="quantity" name="quantity" class="form-control"><option value="0">0</option></select>'); | |
var quantity_max = 100; // <select>の表示上限 | |
var stock_data = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function my_wp_enqueue_scripts() { | |
$handle = 'get_post'; | |
# https://developer.wordpress.org/reference/functions/is_home/ | |
if ( is_home() ) { | |
wp_register_script( $handle, get_theme_file_uri( '/assets/js/get_post.js' ), array( 'jquery' ), false, true); | |
} | |