Skip to main content
edited tags
Link
Qaisar Satti
  • 32.5k
  • 18
  • 87
  • 137
Notice removed Improve details by Baby in Magento
Bounty Ended with Qaisar Satti's answer chosen by Baby in Magento
Tweeted twitter.com/StackMagento/status/722127688870309889
Notice added Improve details by Baby in Magento
Bounty Started worth 100 reputation by Baby in Magento
Notice removed Draw attention by Baby in Magento
Bounty Ended with Codrain Technolabs Pvt Ltd's answer chosen by Baby in Magento
added 815 characters in body
Source Link
Baby in Magento
  • 3k
  • 16
  • 84
  • 223

sellerlist.phtml

complete code of app/design/frontend/default/default/template/mpassignproduct/sellerlist.phtmlsellerlist.phtml` => http://pasted.co/13849662

we tried below script in view.phtml, but it didt worked for me :wk_block.phtml

jQuery(function<?php
    $helper=Mage::helper($'marketplace');
 {   $_product=Mage::registry('current_product');
    function$productowner=Mage::getModel('marketplace/product')->isCustomerProduct($_product['entity_id']);
 getQtyFromString   if(str$productowner['userid']!=""){
         $captchenable = $percent return= str.replaceMage::getStoreConfig( 'marketplace/^\D+marketplace_options/g, ''captcha');
    }

    productQtyFormated = jQuery$rowsocial=Mage::getModel('#product_addtocart_form span.qty''marketplace/userprofile').text->getPartnerProfileById($productowner['userid']);
?>

<div class="block wk-block block-viewed">
 productQty = getQtyFromString <div class="block-title"><strong><span>
    <?php   if(productQtyeFormated$rowsocial['shoptitle']!='');
    productId = 0;      echo $rowsocial['shoptitle'];
    soldBy = ''  else
            echo  $rowsocial['profileurl']; ?>
    </span></strong></div>
    jQuery('#seller-list-new<div form').each(function(index){class="block-content">
        qty<div =class="wk_blockdetail"> getQtyFromString(jQuery(this).find('span span.qty').text()); 
            <ul class="partnerlinks">
        if(qty = 0){      <li>
            productId = jQuery      <a href="<?php echo  Mage::getUrl(this'marketplace/seller/collection').find$rowsocial['profileurl'] ?>" title="<?php echo $helper->__('.mpassignproduct_id''Visit Complete Collection').val ?>" id="siteconnect"><?php echo $helper->__('View Collection') ?></a>
            soldBy =  jQuery </li>
                <li class="profile-view">
                    <a href="<?php echo  Mage::getUrl(this).find('div"marketplace/seller/profile/".wk_seller_profile'$rowsocial['profileurl'] ?>" title="<?php echo $helper->__('Visit Profile').html ?>" id="profileconnect"><?php echo $helper->__('View Profile') ?></a>
        }            <div class="wk-block-hover-div">
                        <div class="arrow"></div>
    });                    <?php echo $rowsocial['compdesi']; ?>
                    </div>
    if(productId > 0){          </li>
        jQuery('#product_addtocart_form span.qty').text(productQtyFormated.replace(SellerQty, assignqty));                          
        jQuery('input:hidden[name=product]').remove        <?php echo $this->getChildHtml();?>
        jQuery('#product_addtocart_form').prepend('<input type="hidden" value="' + productId + '" name="mpassignproduct_id" class="mpassignproduct_id">');
        jQuery('#product_addtocart_form .soled-by-dealer span').html(soldBy)  </ul>
    }    </div>
});    </div> 
</div>

full code of wk_block.phtml : http://pasted.co/0a221176

complete code of app/design/frontend/default/default/template/mpassignproduct/sellerlist.phtml => http://pasted.co/13849662

we tried below script in view.phtml, but it didt worked for me :

jQuery(function($) {
    function getQtyFromString(str){
            return str.replace( /^\D+/g, '')
    }

    productQtyFormated = jQuery('#product_addtocart_form span.qty').text();
    productQty = getQtyFromString(productQtyeFormated);
    productId = 0;
    soldBy = ''


    jQuery('#seller-list-new form').each(function(index){
        qty = getQtyFromString(jQuery(this).find('span span.qty').text());

        if(qty = 0){
            productId = jQuery(this).find('.mpassignproduct_id').val()
            soldBy =  jQuery(this).find('div.wk_seller_profile').html()
        }
        
    });

    if(productId > 0){
        jQuery('#product_addtocart_form span.qty').text(productQtyFormated.replace(SellerQty, assignqty));
        jQuery('input:hidden[name=product]').remove();
        jQuery('#product_addtocart_form').prepend('<input type="hidden" value="' + productId + '" name="mpassignproduct_id" class="mpassignproduct_id">');
        jQuery('#product_addtocart_form .soled-by-dealer span').html(soldBy)
    }
});

sellerlist.phtml

complete code of sellerlist.phtml` => http://pasted.co/13849662

wk_block.phtml

<?php
    $helper=Mage::helper('marketplace');
    $_product=Mage::registry('current_product');
    $productowner=Mage::getModel('marketplace/product')->isCustomerProduct($_product['entity_id']);
    if($productowner['userid']!=""){
        $captchenable = $percent = Mage::getStoreConfig('marketplace/marketplace_options/captcha');
        $rowsocial=Mage::getModel('marketplace/userprofile')->getPartnerProfileById($productowner['userid']);
?>

<div class="block wk-block block-viewed">
    <div class="block-title"><strong><span>
    <?php   if($rowsocial['shoptitle']!='')
            echo $rowsocial['shoptitle'];
        else
            echo  $rowsocial['profileurl']; ?>
    </span></strong></div>
    <div class="block-content">
        <div class="wk_blockdetail">   
            <ul class="partnerlinks">
                <li>
                    <a href="<?php echo  Mage::getUrl('marketplace/seller/collection').$rowsocial['profileurl'] ?>" title="<?php echo $helper->__('Visit Complete Collection') ?>" id="siteconnect"><?php echo $helper->__('View Collection') ?></a>
                </li>
                <li class="profile-view">
                    <a href="<?php echo  Mage::getUrl()."marketplace/seller/profile/".$rowsocial['profileurl'] ?>" title="<?php echo $helper->__('Visit Profile') ?>" id="profileconnect"><?php echo $helper->__('View Profile') ?></a>
                    <div class="wk-block-hover-div">
                        <div class="arrow"></div>
                        <?php echo $rowsocial['compdesi']; ?>
                    </div>
                </li>
                                    
                <?php echo $this->getChildHtml();?>
                
            </ul>
        </div>
    </div> 
</div>

full code of wk_block.phtml : http://pasted.co/0a221176

added 1565 characters in body
Source Link
Baby in Magento
  • 3k
  • 16
  • 84
  • 223

Sellerlist.php

app/code/local/Exam/Mpassignproduct/Block/Sellerlist.php

<?php

class Exam_Mpassignproduct_Block_Sellerlist extends Mage_Core_Block_Template
{
    public function _prepareLayout() {
        return parent::_prepareLayout();
    }

    public function sellerNewProductList() {
        $productid=Mage::registry('current_product')->getId();
        $collection=Mage::getModel('mpassignproduct/mpassignproduct')->getCollection()
                        ->addFieldToFilter('product_id',array('eq'=>$productid))
                        ->addFieldToFilter('qty',array('gt'=>0))
                        ->addFieldToFilter('flag',array('eq'=>'1'))
                        ->addFieldToFilter('product_condition', array('eq'=>'new'));
        $collection->setOrder("price",ASC);
        return $collection;
    }

    public function sellerUsedProductList() {
        $productid=Mage::registry('current_product')->getId();
        $collection = Mage::getModel('mpassignproduct/mpassignproduct')->getCollection()
                        ->addFieldToFilter('product_id',array('eq'=>$productid))
                        ->addFieldToFilter('qty',array('gt'=>0))
                        ->addFieldToFilter('product_condition',array('eq'=>'used'))
                        ->addFieldToFilter('flag',array('eq'=>'1'));
        $collection->setOrder("price",ASC);
        return $collection;
    }
}

Sellerlist.php

app/code/local/Exam/Mpassignproduct/Block/Sellerlist.php

<?php

class Exam_Mpassignproduct_Block_Sellerlist extends Mage_Core_Block_Template
{
    public function _prepareLayout() {
        return parent::_prepareLayout();
    }

    public function sellerNewProductList() {
        $productid=Mage::registry('current_product')->getId();
        $collection=Mage::getModel('mpassignproduct/mpassignproduct')->getCollection()
                        ->addFieldToFilter('product_id',array('eq'=>$productid))
                        ->addFieldToFilter('qty',array('gt'=>0))
                        ->addFieldToFilter('flag',array('eq'=>'1'))
                        ->addFieldToFilter('product_condition', array('eq'=>'new'));
        $collection->setOrder("price",ASC);
        return $collection;
    }

    public function sellerUsedProductList() {
        $productid=Mage::registry('current_product')->getId();
        $collection = Mage::getModel('mpassignproduct/mpassignproduct')->getCollection()
                        ->addFieldToFilter('product_id',array('eq'=>$productid))
                        ->addFieldToFilter('qty',array('gt'=>0))
                        ->addFieldToFilter('product_condition',array('eq'=>'used'))
                        ->addFieldToFilter('flag',array('eq'=>'1'));
        $collection->setOrder("price",ASC);
        return $collection;
    }
}
added 1219 characters in body
Source Link
Baby in Magento
  • 3k
  • 16
  • 84
  • 223
Loading
Notice added Draw attention by Baby in Magento
Bounty Started worth 50 reputation by Baby in Magento
deleted 9158 characters in body; edited title
Source Link
Baby in Magento
  • 3k
  • 16
  • 84
  • 223
Loading
Post Undeleted by Baby in Magento
Post Deleted by Baby in Magento
Source Link
Baby in Magento
  • 3k
  • 16
  • 84
  • 223
Loading