I am fairly new to setting up MVC systems so I'm a little lost on where to begin on this.
I've got an OpenCart 2.3 installation with two stores set up and I need to pull in the product data below from products within one particular category on the primary store, to be called in an HTML module placed on the product pages of the secondary store.
I know it's probably an odd request, and I sincerely apologize for having very literally nothing to start with on the model or controller files. I am not looking for someone to do it for me, just to point me in the right direction.
I assume that the specific category could be selected in the HTML module itself with something along the lines of <?php if ($product['category'] == 'XXX') { ?>, but how do I go about actually pulling that data into the page to be used?
Here is the code chunk I'll be using on the secondary store pages:
Code: Select all
<?php foreach ($[b]PRODUCTFROMSPECIFICCATEGORY [/b]as $product) { ?>
<div class="paint-product-panel" id="<?php echo $model; ?>">
<img src="<?php echo $image['thumb']; ?>">
<h4><?php echo $heading_title; ?></h4>
<p><?php echo $short_desc; ?></p>
<?php foreach ($options as $option) { ?>
<?php if ($option['type'] == 'select') { ?>
<?php if ($option['name'] == 'Quarts') || ($option['name'] != 'Gallons') { ?>
<div class="form-group">
<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="<?php echo $model; ?>-<?php echo $option['name']; ?>" class="form-control" style="font-size: 18px; display: inline-block; width: auto; height: auto;">
<?php foreach ($option['product_option_value'] as $option_value) { ?>
<option value="<?php echo $option_value['product_option_value_id']; ?>"><?php echo $option_value['name']; ?></option><?php } ?>
</select>
</div>
<?php } ?>
<?php } ?>
<?php } ?>
</div>
<?php ]?>