Post by merchboer » Mon Apr 11, 2011 4:03 pm

Ok, here it goes; you'll have to figure out how it works yourself, but with some basic PHP knowledge you'll get there. The coming weeks I don't really have the time to help out/explain since it's incredibly busy at work:

This is in my product.tpl - I gave all products that are available in these quantities the model code "per 250 stuks" (per 250 pcs, but in Dutch).

Code: Select all

<?php if ($display_price) { ?>
            <form action="<?php echo $action; ?>" method="post" enctype="multipart/form-data" id="product">
              <?php if ($options) { ?>
              <b><?php echo $text_options; ?></b><br />
              <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
                <table style="width: 100%;">
                  <?php foreach ($options as $option) { ?>
                  <tr>
                    <td><?php echo $option['name']; ?>: 
                      <select name="option[<?php echo $option['option_id']; ?>]">
                        <?php foreach ($option['option_value'] as $option_value) { ?>
                        <option value="<?php echo $option_value['option_value_id']; ?>"><?php echo $option_value['name']; ?>
                        <?php if ($option_value['price']) { ?>
                        <?php echo $option_value['prefix']; ?><?php echo $option_value['price']; ?>
                        <?php } ?>
                        </option>
                        <?php } ?>
                      </select></td>
                  </tr>
                  <?php } ?>
                </table>
              </div>
              <?php } ?>
              <?php if ($display_price) { ?>
              <?php if ($discounts) { ?>
              <b><?php echo $text_discount; ?></b><br />
              <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px; margin-top: 2px; margin-bottom: 15px;">
                <table style="width: 100%;">
                  <tr>
                    <td style="text-align: right;"><b><?php echo $text_order_quantity; ?></b></td>
                    <td style="text-align: right;"><b><?php echo $text_price_per_item; ?></b></td>
                    <td style="text-align: right;"><b><?php echo $text_pricetotaal; ?></b></td>
                  </tr>
                  <?php foreach ($discounts as $discount) { ?>
                  <tr>
                  <?php $prijsje = (int) preg_replace('/[^\d\.]/','', $discount['price']);
                    $totaaltjes = $discount['quantity'] * $prijsje;
          			if ($model == "per 250 stuks") {
                    $oplages = $discount['quantity'] * 250; } else {
                    $oplages = $discount['quantity'] * 50; }
                    $stuksprijzen = $totaaltjes / $oplages; ?>
                    <td style="text-align: right;"><?php echo $oplages; ?></td>
                    <td style="text-align: right;"><?php echo $stuksprijzen; ?> Eurocent</td>
                    
                    <td style="text-align: right;"><b>&euro; <?php echo substr_replace($totaaltjes,',',-2,0); ?></b></td>
                  </tr>
                  <?php } ?>
                </table>
              </div>
              <?php } ?>
              <?php } ?>
              <div style="background: #F7F7F7; border: 1px solid #DDDDDD; padding: 10px;"><?php echo $text_qty; ?>
              <?php if ($discounts) { ?>
              <select name="quantity">
                  <?php if ($model == "per 250 stuks") { 
                  $oplage = $minimum * 250; } else { 
                  $oplage = $minimum * 50; }
                  ?>
                  <option value="<?php echo $minimum; ?>"><?php echo $oplage; ?></option>
                  <?php foreach ($discounts as $discount) {
                  if ($model == "per 250 stuks") { 
                  $oplages = $discount['quantity'] * 250; } else { 
                  $oplages = $discount['quantity'] * 50; }
                  ?>
                  <option value="<?php echo $discount['quantity']; ?>"><?php echo $oplages; ?></option>
                  <?php } ?>
                </select>
              <?php } else { ?>
                <input type="text" name="quantity" size="3" value="<?php echo $minimum; ?>" />
              <?php } ?>
                <a onclick="$('#product').submit();" id="add_to_cart" class="button"><span><?php echo $button_add_to_cart; ?></span></a></div>
              <input type="hidden" name="product_id" value="<?php echo $product_id; ?>" />
              <input type="hidden" name="redirect" value="<?php echo $redirect; ?>" />
            </form>
            <?php } ?></td>
        </tr>
      
    </table>

I likez teh beerz & foodz.


User avatar
Active Member

Posts

Joined
Fri Jan 14, 2011 4:27 pm
Location - Netherlands

Post by kamehashop » Fri Nov 25, 2011 4:17 pm

is there any of this module for oc 1.5.x.x?

Image Image


User avatar
Newbie

Posts

Joined
Mon Nov 07, 2011 8:29 pm
Location - Cirebon - Indonesia

Post by wzzly » Fri Oct 19, 2012 9:23 pm

I tried the code changes for 1.5.* but it doesn't work. Anyone got this working on 1.5.4 ?
Thanks

Newbie

Posts

Joined
Fri Oct 19, 2012 9:22 pm

Post by dmajcan » Fri May 24, 2013 7:07 pm

i have it working on 1.5.4 but on products with minimum quantity and color picker i have a problem.

i have a product with 3 color options, buyer must choose a color before he orders, but it places chosen color in cart and product without any color, it duplicates product in cart

New member

Posts

Joined
Tue Oct 16, 2012 3:48 am

Post by aceveve » Thu Sep 19, 2013 1:59 am

dmajcan wrote:i have it working on 1.5.4 but on products with minimum quantity and color picker i have a problem.

i have a product with 3 color options, buyer must choose a color before he orders, but it places chosen color in cart and product without any color, it duplicates product in cart
Any solution for this? :)

Newbie

Posts

Joined
Thu Sep 19, 2013 1:57 am

Post by SVN » Thu Dec 12, 2013 7:27 pm

Is this module still available ?
The download link does not work anymore.

Thank you,
Steven

OC 1.4.9.6

User avatar
SVN
Active Member

Posts

Joined
Mon Jan 03, 2011 11:59 pm
Who is online

Users browsing this forum: No registered users and 4 guests