Raise the first price of option to the main OpenCart



  • The main price of my product is an option, and the basic price of the LO is 0. How is it right to remove the value of the product from the station?

    This is the price on the front page:

            <?php if ($product['price']) { ?>
        <div class="price">
          <?php if (!$product['special']) {  ?>
            <span class="price-new"><?php echo $product['price']; ?></span>
            <?php if( preg_match( '#(\d+).?(\d+)#',  $product['price'], $p ) ) { ?> 
            <?php } ?>
          <?php } else { ?>
            <span class="price-new"><?php echo $product['special']; ?></span><br>
            <span class="price-old"><?php echo $product['price']; ?></span> 
            <?php if( preg_match( '#(\d+).?(\d+)#',  $product['special'], $p ) ) { ?> 
            <?php } ?>
    
      &lt;?php } ?&gt;
    &lt;/div&gt;
    &lt;?php } ?&gt; 
    

    And it's like I've got product inside:

                            <div class="form-group<?php echo ($option['required'] ? ' required' : ''); ?>">
    <label class="control-label" for="input-option<?php echo $option['product_option_id']; ?>"><?php echo $option['name']; ?></label>
    <select name="option[<?php echo $option['product_option_id']; ?>]" id="input-option<?php echo $option['product_option_id']; ?>" class="form-control">
    <?php foreach ($option['product_option_value'] as $option_value) { ?>
    <option value="<?php echo $option_value['product_option_value_id']; ?>" points="<?php echo (isset($option_value['points_value']) ? $option_value['points_value'] : 0); ?>" price_prefix="<?php echo $option_value['price_prefix']; ?>" price="<?php echo $option_value['price_value']; ?>"><?php echo $option_value['name']; ?>
    <?php if ($option_value['price']) { ?>
    <?php
    if ($option_value['price_prefix'] == '*') {
    if ($option_value['price_value'] != 1.0)
    printf("(%+d%%)", round(($option_value['price_value'] * 100) - 100) );
    } else {
    echo "(".$option_value['price'].")";
    }
    ?>
    <?php } ?>
    </option>
    <?php } ?>
    <option value=""><?php echo $text_select; ?></option>
    </select>
    </div>
    <?php } ?>

    How is it right to put the main price of the opaque at the top? Doing with the help of:

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

    It's just a void, no price. ♪ ♪ )



  • That's the line you've got in the cycle, taking all the options and taking out the information about the ops.

    And you're taking an empty mass and you're trying to get a price out of it.

    Elementary, your cap.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2