<?php echo $ option ['price']; ?>在cart.tpl上不起作用-Opencart 2.2

时间:2019-08-19 20:37:12

标签: opencart2.x

This is what I get

<?php echo $option['price']; ?>在购物车上不起作用。tpl-Opencart 2.2

<td class="text-left"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> 
              <?php if (!$product['stock']) { ?>
              <span class="text-danger">***</span>
              <?php } ?>
              <?php if ($product['option']) { ?> 
              <?php foreach ($product['option'] as $option) { ?>
              <br />
              <small><?php echo $option['name']; ?>: 
                  <?php echo $option['value']; ?> - Price 
                  <?php echo $option['price']; ?>
                  </small> 
              <?php } ?>
              <?php } ?>
              <?php if ($product['reward']) { ?>
              <br />
              <small><?php echo $product['reward']; ?></small>
              <?php } ?>
              <?php if ($product['recurring']) { ?>
              <br />
              <span class="label label-info"><?php echo $text_recurring_item; ?></span> <small><?php echo $product['recurring']; ?></small>
              <?php } ?></td>

1 个答案:

答案 0 :(得分:0)

以下解决方案将对您非常有帮助。

<?php echo $option['price']; ?>

代替

<?php echo isset($option['price']); ?>

我认为它已解决,但未发现任何错误。

<td class="text-left"><a href="<?php echo $product['href']; ?>"><?php echo $product['name']; ?></a> 
              <?php if (!$product['stock']) { ?>
              <span class="text-danger">***</span>
              <?php } ?>
              <?php if ($product['option']) { ?> 
              <?php foreach ($product['option'] as $option) { ?>
              <br />
              <small><?php echo $option['name']; ?>: 
                  <?php echo $option['value']; ?> - Price 
                  <?php echo isset($option['price']); ?>
                  </small> 
              <?php } ?>
              <?php } ?>
              <?php if ($product['reward']) { ?>
              <br />
              <small><?php echo $product['reward']; ?></small>
              <?php } ?>
              <?php if ($product['recurring']) { ?>
              <br />
              <span class="label label-info"><?php echo $text_recurring_item; ?></span> <small><?php echo $product['recurring']; ?></small>
              <?php } ?></td>