I want the add to cart block to show up next to EACH vendor. Because this is all dynamically created, I had to pass the vendor ID to an "add to cart" script that I created. I took the original app/design/frontend/base/default/template/catalog/product/view/addtocart.phtml and made my own as seen below. The following php file is called via ajax. The original addtocart.phtml had a bunch of $this variables. I need to simulate $this (whatever model, helper its referring to) so that this block works. I am without much success. Can someone see what I am doing wrong or what I could do differently? Thanks so much!
<?php require_once('/var/www/Staging/public_html/app/Mage.php'); ?> <?php umask(0); Mage::app();?> <?php $value = $_POST['value'];?> <?php $block = Mage::getModel('catalog/product');?> <?php $_product = Mage::registry('current_product'); ?> <?php //if($_product->isSaleable()): ?> <div class="add-to-cart"> <?php //if(!$_product->isGrouped()): ?> <label for="qty"><?php echo $block->__('Qty:') ?></label> <input type="text" name="qty" id="qty" maxlength="12" value="<?php echo $block->getProductDefaultQty() * 1 ?>" title="<?php echo $block->__('Qty') ?>" class="input-text qty" /> <?php //endif; ?> <button type="button" title="<?php echo $buttonTitle ?>" class="button btn-cart" id='$value'><span><span><?php echo $buttonTitle ?></span></span></button> <?php echo $block->getChildHtml('', true, true) ?> </div> <?php //endif; ?>