#StackBounty: #magento-1.9 #category #catalogsearch #sorting How to display search results sorted by categories

Bounty: 50

I need to sort my search results by product categories.

If I have Product A and Product B in Category A
And I have Product C and Product D in Category B

If all products are available in search result, I want to show them like,

Product A, Product B, Product C, Product D

I want to put same category products with each other on results page.

Currently It is showing as

Product A, Product C, Product B, Product D

I have tried this but its not working.


Get this bounty!!!

#StackBounty: #magento-1.9 remove validation for Add to cart

Bounty: 50

user can upload image and text on product image, after that user muct click on custom button “save design” , after that only onclick “Add to cart” button will add item to cart. but we want to remove that validation for add to cart button.

What i need is Once user upload image or text and if user click on “Add to cart”, it should add item to cart.

We have below code for “save design

_getControlPanelHtml: function()
    {
        if (this.config.editorEnabled) {
            return '
' + '' + '' + '
'; } return ''; }, initObservers: function() { if (this.config.editorEnabled) { $('submit-editorApply-' + this.config.rand).observe('click', this.submitApply.bindAsEventListener(this)); $('submit-editorReset-' + this.config.rand).observe('click', this.submitReset.bindAsEventListener(this)); } }, submitApply: function(event) { Event.stop(event); this.option.apply(); },

I tried below code , now “Add to cart” is working without clicking “save design”, but after clicking “save design”, than “Add to cart” is not working.

<script>

initObservers: function()
    {
        if (this.config.editorEnabled) {
            $('submit-editorApply-' + this.config.rand).observe('click', this.submitApply.bindAsEventListener(this));
            $('submit-editorReset-' + this.config.rand).observe('click', this.submitReset.bindAsEventListener(this));

            var buttonCart = $$('.btn-cart')[0];
            buttonCart.removeAttribute('onclick');
            buttonCart.observe('click', this.addToCart.bindAsEventListener(this));
            console.log(buttonCart);
        }
    },

    addToCart: function(event)
    {
        Event.stop(event);
        this.submitApply(event);

        productAddToCartForm.submit(this)
    },

phtml : https://pastebin.com/xeWKNUs4 , script : https://pastebin.com/p8UU7zQ1

enter image description here


Get this bounty!!!

#StackBounty: #magento-1.9 #filter #filtered-nav error in catalog view layered navigation filter

Bounty: 50

This is the block from my catalogsearch.xml

<reference name="left">
        <block type="catalogsearch/layer" name="catalogsearch.leftnav" after="currency" template="catalog/layer/view.phtml"/>
    </reference>

The selected filters are displaying multiple time.I tried changing the type and still no change,
Please Help.
enter image description here

update :

in my cataloglayerstate.phtml

$_filters = $this->getActiveFilters();
count($_filters) 

is returning me 3 which should be only one .Please help why this is happening


Get this bounty!!!

#StackBounty: #magento-1.9 #product #product-view Guest = > onlick button => login = >save product [ similar to wishlist]

Bounty: 50

short :

Once registered user click on button its creating product and assign that product to him.
what i need : once guest user click on button , i need to assign product after guest logged in.

Detail :

By Default ,if Guest user click on “Add to wishlist” button, than it will redirect to login or register page, once user login/regitered, than the product added by user will automatically display under “My wishlist” tab.

Question : We need similar feature for custom button “save design” in product view page

if the Registered user upload image and click on “save design” button we are saving image in database & creating new product.

Issue : once guest user upload image on product image & click on “save design” button, we are displaying pop up box to register or login. once guest user logged in, the image that uploaded by user is not saving in Database.

enter image description here

pop up after click on “save design”

enter image description here

if the Register user upload image and click on “save design” button we are saving image in database.

Abstarct.js

<button id="submit-editorApply-{{rand}}" >save design</button>

initObservers: function()
    {
        if (this.config.editorEnabled) {
            $('submit-editorApply-' + this.config.rand).observe('click', this.submitApply.bindAsEventListener(this));
            $('submit-editorReset-' + this.config.rand).observe('click', this.submitReset.bindAsEventListener(this));
        }
    },

    submitApply: function(event)
    {
        Event.stop(event);
        this.option.apply();
    },

cgfile.phtml

Save: {
saveImageDefaultUrl   : '<?php echo Mage::helper('aitcg')->getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/createImageDefault',array('id' => 
Mage::registry("current_product")->getId()))); ?>',
}

controllers for saving product : http://pastebin.com/7kb4WUDZ

phtml : http://pastebin.com/ii0BESnZ

js : http://pastebin.com/uAqQmX4Q


Get this bounty!!!

#StackBounty: #magento-1.9 #tax #vat Magento VAT calculation issue with Price Inclusive TAX

Bounty: 50

I have product with Price 6.50 € which includes 24% VAT in it.
When I add it to cart, for 1 quantity the price shows correct.

Net value     5.24 €
VAT 24%       1.26 €
Total value   6,50 €

Now if I add 3 products to cart, the total becomes incorrect.

Net value     15.72 €
VAT 24%       3.77 €
Total value   19,49 €

Which is 0.01€ less than correct subtotal. It should be,

Net value     15.72 €
VAT 24%       3.78 €
Total value   19,50 €

Here you can see that VAT value is calculated wrong. It calculates 24% of 15.72 which is 3.77 and its correct, but it should be calculated on each product and then summed up to be 3.78


Get this bounty!!!

#StackBounty: #magento-1.9 #orders #sales-order #quote #sales-quote convert quote to order for guest users

Bounty: 50

Hi I am converting a quote to order programatically. 929 is a quote id of a guest user.When i am trying a actual customers quote id it is working fine.but for guest this is not working. giving error as

Fatal error: Call to a member function getIncrementId() on a
non-object

here is my code

$quoteObj = Mage::getModel('sales/quote')->load(929); // Mage_Sales_Model_Quote
        $items = $quoteObj->getAllItems();  
         $quoteObj->reserveOrderId();

        //print_r($items);
$addressData = array(
        'firstname' => 'Test',
        'lastname' => 'Test',
        'street' => 'Sample Street 10',
        'city' => 'Somewhere',
        'postcode' => '123456',
        'telephone' => '123456',
        'country_id' => 'US',
        'region_id' => 12, // id from directory_country_region table
);

$billingAddress = $quoteObj->getBillingAddress()->addData($addressData);
$shippingAddress = $quoteObj->getShippingAddress()->addData($addressData);

$shippingAddress->setCollectShippingRates(true)->collectShippingRates()
                ->setShippingMethod('flatrate_flatrate')
                ->setPaymentMethod('checkmo');

$quoteObj->getPayment()->importData(array('method' => 'checkmo'));

$quoteObj->collectTotals()->save();

$service = Mage::getModel('sales/service_quote', $quoteObj);
$service->submitAll();
$order = $service->getOrder();

printf("Created order %sn", $order->getIncrementId());

Please Help.


Get this bounty!!!

#StackBounty: #magento-1.9 Display Pop up box to Register or Login after click on button

Bounty: 50

We have feature called “Productlike” similar to Add to wishlist , here once user click on “productlike icon“, we will check user is Registered or not, if user is Registered, we will display that product under Customer’s Account information as below :

product like icon

enter image description here

product like icon in listing page

enter image description here

My Product like menu in customer Profile page

enter image description here

If User is not Registered than once user click on “Product like” button, than we will display pop up to Register or Login as below image :

enter image description here

Now we are trying to implement similar kind of Feature for one more button present in Product view page.

Here once user upload image or Add Text , than click on “SAVE DESIGN” button, here we directly saving the image without caring about user registered or not.

But here also if User is Not Registered, than we need to display pop up as above image. once User Registered or login , after that we need to display that Product under Customer Profile Page.

Code for Product Like button is as below [ we have complete module for this]

getEntityId()?>" onclick="saveproductLike('getEntityId()?>','','');" src="getSkinUrl($customerlikeProductimage) ?>"/> getSkinUrl($customerlikeProductimage) ?>"/>
getEntityId()?>');setrequestlogin();"> getSkinUrl('images/plike.png'); ?>"/>
<?php }?>
getEntityId()?>">
</div>

We included SAVE DESIGN button in Js file as below code.


_getControlPanelHtml: function()
    {
        if (this.config.editorEnabled) {
            return '
' + '' + '
'; } return ''; },

So How i can take “Product like button” code as Reference to implement same feature for “SAVE DESIGN” button.
please give me some idea and help me


Get this bounty!!!

#StackBounty: #magento-1.9 #admin #error Magento Forbidden Error On Backend

Bounty: 50

When I Logged in Magento error not display but as I refresh or nevigate to other pages it shows error on every page till three or four navigations then error hide automatically. I access all pages but I wants to know why this error come and how t o solve this.
I have tried below commands but it not works for me

    find ./ -type f | xargs chmod 644
    find ./ -type d | xargs chmod 755
    chmod -Rf 777 var
    chmod -Rf 777 media

enter image description here


Get this bounty!!!

#StackBounty: #magento-1.9 #catalogsearch Quick search – how to use attributes via parameters ?

Bounty: 100

I have this working in advanced search :

catalogsearch/advanced/result/?name=vanille&is_bio=1

Every product whose name contains “vanille” and attribute “is_bio” set to true will appear.

Now since I need to search not just in “name” but also other fields like “brands”, I have to use quick search and its “q” query (correct me if I’m wrong). But in this case attributes won’t have any effect :

catalogsearch/result/?q=vanille&is_bio=1

Will show every products containing “vanille” whatever the value of “is_bio”.

Is there anyway to activate params in quick search ?


Get this bounty!!!

#StackBounty: #magento-1.9 save both image and text in as single image

Bounty: 100

we have product image in site like below image

enter image description here

We are providing an option for customer to upload custom image on product image.

enter image description here

also customer can and add text on that image

enter image description here

than customer add product to cart and place an order in backend, we can see the same image as below :

enter image description here

Here Problem is Customized Product design is saving as 2 different images in server [ Text & uploaded image separately] but what we want is once Customer click on “save design” or “add to cart” or if customer upload image and text , we want to save that “customized Product image” in server as single image. right now we are saving both image and text as different image as below links :

image path : http://sbdev2.kidsdial.com:81/media/custom_product_preview/quote/White_Background_Iphone_Pics_1_2.jpg

enter image description here

text path : http://sbdev2.kidsdial.com:81/media/custom_product_preview/quote/1b22f071-0056-0b80.png

enter image description here

<?php
/**
 * @var $this Aitoc_Aitcg_Block_Catalog_Product_View_Options_Type_File
 */
$_option = $this->getOption();
$_fileInfo = $this->getFileInfo();
$_image = $this->getImage();
$_rand = rand();
$_fileOption = 'options_' . $_option->getId();
$_preview = $this->getPreview();
$_defaultValues = isset($_preview['img_data']) ?
    $_preview :
    array('img_data' => '');
$checkboxEnabled = (int)Mage::getStoreConfig('catalog/aitcg/aitcg_confirm_checkbox');
if ($checkboxEnabled) {
    $fullCheckboxEnabled = Mage::getStoreConfig('catalog/aitcg/aitcg_confirm_fullcheckbox');
}
$sharedImgId  = Mage::helper('aitcg')->getSharedImgId($_rand);
$sharedImgUrl = Mage::helper('aitcg')->getSharedImgUrl($sharedImgId);
$sharedImgWasCreatedUrl = Mage::helper('aitcg')->getSharedImgWasCreatedUrl(); ?>
<link rel="stylesheet" type="text/css" href="<?php echo Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS);?>fancybox/jquery.fancybox.css" />


    // = {
    
    optionIsRequired: getIsRequire(); ?>,

    productImage: {
        fullUrl: '',
        sizeX  :  ,
        sizeY  :  ,

        thumb: {
            fullUrl: '',
            sizeX  :  ,
            sizeY  :  
        }
    },

    area: {
        sizeX  : getAreaSizeX() ?>,
        sizeY  : getAreaSizeY() ?>,
        offsetX: getAreaOffsetX() ?>,
        offsetY: getAreaOffsetY() ?>
    },

    tools: {
        use: {
            PredefinedImage: getUsePredefinedImage() ?>,
            Mask           : getUseMasks() ?>,
            UserImage      : getUseUserImage() ?>,
            Text           : getUseText() ?>,
            Social         : ,
            Save           : 1
        },
        global: ['Save', 'Social'],
        PredefinedImage: {
            requestUrl        : 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/addPredefined')); ?>',
            options           :  getPredefinedCatsOptionHtml($_option->getPredefinedCats()); ?>'',
            categoryPreviewUrl: 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/categoryPreview'))?>',
            placeBehind    :  getAllowPlaceBehind()?>,
            DefaultImageBehind: getDefImgBehindClip() ?>
        },
        Mask: {
            requestUrl        : 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/addMask')); ?>',
            options           :  getMaskCatsOptionHtml($_option->getMasksCatId()); ?>'',
            categoryPreviewUrl: 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/masksCategory'))?>',
            location          :  getMaskLocation() ?>,
            createMaskUrl     : 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/createMask')); ?>',
            getMaskUrl        : 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/getMask')); ?>',
            delMaskUrl        : 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/delMask')); ?>'
        },
        UserImage: {
            requestUrl: 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/addImage')); ?>',
            placeBehind    :  getAllowPlaceBehind()?>,
            DefaultImageBehind: getDefImgBehindImage() ?>
        },
        Text: {
            requestUrl     : 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/addText')); ?>',
            textLength     :  getTextLength() ?>,
            fontOptions    : 'getFontOptionHtml(); ?>',
            fontPreviewUrl : 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/fontPreview'))?>',
            useOutline     :  ,
            useShadow      :  ,
            useColorpick   :  getAllowColorpick() ?>,
            onlyPredefColor:  getAllowPredefinedColors()?>,
            colorSet       : 'getColorset()->getValue();?>',
            placeBehind    :  getAllowPlaceBehind()?>,
            DefaultImageBehind: getDefImgBehindText() ?>
        },
        Social: {
            imgCreatePath   : 'getImgCreatePath() ?>',
            reservedImgId   : '',
            imgViewUrl      : '',
            wasCreatedUrl   : '',
            allowChecking   :  
        },
        Save: {
            saveSvgUrl            : 'getSecureUnsecureUrl(Mage::getUrl('aitcg/index/svg')); ?>',
            normalizateSvgToPngUrl: 'getSecureUnsecureUrl(Mage::getUrl('aitcg/index/svgtopng')); ?>',
            //getPrint - to update
            savePdfUrl            : 'getSecureUnsecureUrl($this->getSavePdfUrl()); ?>',
            saveImageDefaultUrl   : 'getSecureUnsecureUrl(Mage::getUrl('aitcg/ajax/createImageDefault')); ?>',
            isShow                : getAllowSaveGraphics() ?>
        }
    },

    jsUrl: '',  
    editorEnabled: true,

    
        editorEnabled: false,

        
        viewType: '',
        rand: '',
        checkboxEnabled: ,
        allowUploadUnderTemplate: 1,

        product_id        : 'getProductId(); ?>',
        optionId          :  getId() ?>,
        distortion        :  isObjectDistortionAllowed()?>,
        previewContainer  : 'preview_containergetId(); ?>',

        toolboxStyle: ''
    };
    Object.extend(aitcgConfig, aitcgBaseConfig);
    //]]>

<dt><label<?php if ($_option->getIsRequire()) : ?> class="required"<?php endif ?>><?php //echo  $this->htmlEscape($_option->getTitle()) ?><?php if($this->isMageGtEq19() && $_option->getIsRequire()) : ?><em>*</em><?php elseif ($_option->getIsRequire()) : ?> <span class="required"><em>*</em></span><?php endif ?></label>
    <?php echo $this->getFormatedPrice() ?></dt>
<dd<?php if ($_option->decoratedIsLast){?> class="last"<?php }?>>
    
__('Sorry, but your browser does NOT support HTML5 elements and this feature is not working or may work incorrectly.');?>
__('Please, try using different browser.');?> __('Please, try using different browser (Opera Mini for example) or update your Android to a newer version.');?>
<?php //echo $this->__('Click on the thumbnail to choose the product image for editing.'); ?>
getId(); ?>">
<input type="hidden" id="options_<?php echo $_option->getId() ?>" class="input-text<?php echo $_option->getIsRequire() ? ' aitcg-required' : '' ?> product-custom-option" name="options[<?php echo $_option->getId() ?>]" value='<?php echo $this->htmlEscape($_defaultValues['img_data'])?>' /> <?php if ($checkboxEnabled == 1): ?> <p class="no-margin"> <input type="checkbox" name="<?php echo $_rand; ?>_checkbox" id="<?php echo $_fileOption; ?>_checkbox" class="product-custom-option <?php if ($_option->getIsRequire()) : ?>required-entry<?php endif ?>" <?php if($fullCheckboxEnabled == 1): ?>onClick="return opCimage<?php echo $_rand; ?>.checkConfirmBox(this);" <?php endif; ?>/> <?php if($fullCheckboxEnabled == 1): ?> <a href="#" onClick="return opCimage<?php echo $_rand; ?>.checkConfirmBox(this);"><?php echo Mage::getStoreConfig('catalog/aitcg/aitcg_confirm_text'); ?></a> <?php else: ?> <label for="<?php echo $_fileOption; ?>_checkbox"><?php echo Mage::getStoreConfig('catalog/aitcg/aitcg_confirm_text'); ?></label> <?php endif; ?> </p> <?php endif; ?> </div> </dd> // = null; aitcgWindowOnload.push( function(){ opCimage = new Aitcg_Option( aitcgConfig ); opCimage.view.initPreview(); isVYAEnabled()): ?> if(typeof objectsCPPVYA == 'undefined'){ objectsCPPVYA = []; } objectsCPPVYA.unshift(opCimage); }); //]]> <img class='techimg' style="display:none;"> <?php if(Mage::getStoreConfig('catalog/aitcg/aitcg_use_social_networks_sharing')) : ?>
getId() ?>" style="display:none;"> __('Click to share your customized image'); ?>
getId() ?>" style="display:none;"> __('You image exceeds maximum allowed size'); echo ' (' . Mage::getStoreConfig('catalog/aitcg/aitcg_social_networks_sharing_max_img_width') . 'x' . Mage::getStoreConfig('catalog/aitcg/aitcg_social_networks_sharing_max_img_height') . ')';?>
getId() ?>" data-layout="button_count" data-href="" data-send="true" data-show-faces="false">
getId() ?>" style="display:inline;">
<?php if ($this->canEmailToFriend()): ?> <?php $emailToFriendUrl = Mage::helper('aitcg')->getEmailToFriendUrl($this->getProduct(), $sharedImgId) ?> <?php endif; ?>
getId() ?>" style="display:none;">getSkinUrl('images/opc-ajax-loader.gif') ?>" alt="__('Email to a Friend') ?>" />
<?php endif; ?> function openCustimage(id) { if(id=="UserImage"){ jQuery('#aitcg-control-panel').css('bottom','145px'); jQuery('#customproductrelay').css('display','block'); jQuery('#fancyusercustimg').fadeIn(1000); } else{jQuery('#aitcg-control-panel').css('bottom','74px');} } function closePopup() { jQuery('#fancyusercustimg').fadeOut(1000); jQuery('#customproductrelay').css('display','none'); } function openfiletoupload() { jQuery('.newcustomimage').trigger("click"); } function opencolorpalate() { jQuery('.jscolorpicker').trigger("focus"); } function updatecolor(jscolorpicker) { jQuery('.aitcg_image_container').css("background","#"+jscolorpicker); } function testtect() { jQuery('button[id^="submit-text-edit"]').trigger('click'); } jQuery('#colorfield431527072').change(function() { alert("dfg"); jQuery('button[id^="submit-text-edit"]').trigger('click'); }); // to dislay image preview 1 jQuery(document).ready(function() { jQuery('body').on('.newcustomimage', 'change', function() { if (jQuery(this).val()) { console.log(jQuery(this).val()); if (jQuery(this).val()) { var reader = new FileReader(); } jQuery(this).parent().parent().append('
Image Uploaded.
'); } }); jQuery(document).on(".aitcg-button", "click", function() { jQuery('#aitcg-tool-UserImage #previewImg')[0].hide(); }); }); function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function(e) { jQuery('#previewImg').attr('src', e.target.result); jQuery('#previewImg').show(); }; reader.readAsDataURL(input.files[0]); } }


Get this bounty!!!