texts: DOM can't read right the opening Tag of a XML file

texts:
I work with Magento ver. 2.1.7 and when I open the admin panel, I get this message after only trying to navigate to (Stores -> Configuration)

  Warning: DOMDocument::loadXML(): Start tag expected, '&lt;' not found in Entity, line: 1 in /srv/www/my-project/vendor/magento/module-config/Model/Config/Structure/Reader.php on line 132

I think it means that the < is missing from the opening Tag of a XML File after trying to open the Configuration in the Admin-Backend.

Any suggestions will be appreciated.


texts: How can I disable access to local.xml and config.xml for external visitors?

texts:
I problem that anybody from web can observe my file local.xml and config.xml

I enabled Deny From all in htaccess file in folder app and direct access have been disabled for all files in this folder except for local.xml and config.xml. Unfortunately.

Can somebody advice anything?

Thankx


texts: Is it possible to define the SKU only to be unique on website level (not globally)

texts:
In the store, the store views / website's products are kept separated.

To avoid overlap of SKUs, we have to approaches:

Add a prefix during import (but we might need to remove that when displaying)
Define SKU to be only unique on website level.

Is this second approach generally possible?


texts: Trying to move header links to footer links by move in default.xml

texts:
I am trying to move the header.links (login) to the footer by putting default.xml in

app/design/frontend/vendor/themename/Magento_Theme/layout/

Here is my code.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">

<body>
    <move element="header.links" destination="footer_links" />
</body>

I have tried

php bin/magento cache:flush
rm -rf var/generation
var/cache var/page_cache
rm -rf pub/static/frontend/

to remove static files and cache and also setup:upgrade to update Magento. Is there anything I am doing wrong? The links wont move.


texts:
I want to move search textbox and cart image to left side of top links.

For this i have created theme puma and specified parent as luma.
After customer login top links moved to dropdown. Now I want to move search textbox and cart image to left side of top links.

I have identified search textbox is coming from vendor/magento/module-search/view/frontend/templates/form.mini.phtml, and its layout default.xml in vendor/magento/module-search/ and its block name as topSearch.

so i have created Module_Search folder -> layout folder and default.xml file in app/design/frontend/puma.

And i wrote <move element="topSearch" destination="top.links" before="customer"/> but its not working.

Assume i was perfect till identifying block but i could not identify destination value, I have seen Magento_Theme->page_layout->1column.xml but could not identify.


texts: Gel All Product images url using product id

texts: Most of magento products have more than one product image, i've read this post on how to retrieve product image url, but it seems it only retrieve one image, i want to to load the product images url only by using product id and when i copy the one of images url to browser window the image will show up , is there any chance to do this?


texts: Magento 2, custom cms layout, override general removal of a block

texts:
In my /app/design/frontend/myVendor/myTheme/Magento_Theme/layout/default.xml
I have below :

<referenceBlock name="breadcrumbs" remove="true" />

And in my custom layout for a specefic page I need to have it. So in my

app/design/frontend/myVendor/myTheme/Magento_Theme/page_layout/myCustomPage-layout.xml

I added below:

<referenceContainer name="page.top">
        <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/>
</referenceContainer>

But can not get the breadcrumb display.


texts: Magento2 cloud fastly bypass specific URL

texts:
I've a magento 2 commerce site(hosted on magento cloud, it is using fastly full page cache) when it saving customer additional address, it will show

The requested URL was rejected.

For additional information, please contact support and provide this reference ID:

ca021a552d6bc561cc2e95e626ee68c2750f4ac24571eb1fc249a0941832b1ea

Go Back

Here is the target form post action

https://www.example.com/customer/address/formPost/id/1450/

Is it possible to set about url (https://www.example.com/customer/address/formPost/*) bypass fastly cache?


texts: Unable to synchronize Magento site products with MRPEasy app

texts:
I'm running Magento 2.1.8. I've installed MRPEasy integration extension and configured the API key, access key on my Magento application.

I'm not able to synchronize my site products, orders, customers and other details with MRPEasy cloud-based app.

When I try to Synchronize, it shows the last synchronization time. but it doesn't show the synchronized products, orders, customers and other details in the MRPEasy app.

Any help would be really appreciated.


texts: Ho can i get data from sales_invoiced_aggregated table

texts:
I am trying to export invoice report data externally.

How can i collect data from this table sales_invoiced_aggregated?


texts: how to use/integrate "Uploadify" in magento

texts:
I want to use uploadify to add the images in my custom form.
I have placed all the js and css to their respective places but what I didn't understand is how to use the jquery functions in the form as it is used in the uploadify form.

here is the index.php of uploadify which has its form.

Uploadify Demo

    <form>

        <input id="file_upload" name="file_upload" type="file" multiple="true" enctype='multipart/form-data'>
        Upload Files
    </form>

I know we can use the jquery function like this in the phtml files in frontend, but how I can use this in backend.
here is my custom form for the image

  <?php
  class Vertax_Blog_Block_Adminhtml_Article_Edit_Tab_Image extends Mage_Adminhtml_Block_Widget_Form
  {
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $this->setForm($form);
     $fieldset = $form->addFieldset('image_form',
                     array('legend'=>'image'));
      $fieldset->addField('image', 'image', array(
      'label'     => 'Image',
      'required'  =>  false,
      'name'      => 'image',
      'multiple'  => 'multiple',
      'mulitple'  =>  true,
      ));
      if (Mage::getSingleton('adminhtml/session')->getBlogPostData()) {
      $form->setValues(Mage::getSingleton('adminhtml/session')->getBlogPostData());
      Mage::getSingleton('adminhtml/session')->setBlogPostData(null);
      } elseif (Mage::registry('article_data')) {
      $form->setValues(Mage::registry('article_data')->getData());
      }
      return parent::_prepareForm();
   }
  }
  ?>


texts: 404 Error When I Rename Store-View Code in Magento 1.7.0.2

texts:
This error has been eating my head since 2 days! I have searched the entire internet!

Scene:
I have a Magento store (1.7.0.2) with 1 website, 1 store and 2 storeviews.
First store view code is my_uk_en
Second store view code is my_uk_ru

Everything works fine until I rename (change) the StoreView to something else.
I renamed the storeview code to my_cz_en, and frontend gives 404 error.

I have checked my index.php and .htaccess files, there is no store called explicitly.

I tried running the new store forecefully by using the following in index.php

$mageRunCode = "my_cz_en";
$mageRunType = "store";
Mage::run($mageRunCode, $mageRunType);

But still same 404!
I also ran a search on my entire database with the old storeview code (my_uk_en) and there was no matches.

The storeview is assigned to a CMS homepage as well. The setting Add Store Code to URL is disabled.

Reindex Done. Cache Disabled

Inspite of all these I don't understand why I am getting 404 error.


texts: How to import products form 3 different sites to new magento site?

texts:
There is a requirement in my new site is that it will show product from 3 different website, not the store but the complete different website.

My Question is how i am gonna achieve it, if i setup a master slave db then there will be problem as there can only be one master in my knowledge.

So how can i achieve it, what should i do to import products and category from 3 different site to my site, and also setup a process so when any of the site updates its products my new site gets updates too.


texts:
I'm having a problem on a client website, which seems to also occur in a fresh install of Magento.  I've set up a custom role "test", and I tick OAuth Authorized Tokens, and hit save.  When I go back to the page, it doesn't stay ticked.  It seems to save the value in admin_rule, but it's not reflected in the checkbox on returning to the page.

The issue arose due to some custom code having the same issue.  The developer had added a capital letter into the XML node name for ACL in their system.xml.  Once changed and re-set, these then remained ticked.

Sure enough, I've found that if I change Magento's XML node to authorizedtokens instead of authorizedTokens, it saves and restores the setting correctly.

Is this a bug?  It's an annoying one, as I'm not sure the client is actually likely to usee this feature, but they've pointed it out.  Seems daft to have to rewrite a couple of classes and update the ACL XML node to get this to work.


texts: Need to override following file rules.js

texts:
magento2.3.3/pub/static/adminhtml/Magento/backend/da_DK/Magento_Ui/js/lib/validation/rules.js

I need to override rules.js for specific Danish locale only for Admin area, how can I achieve that.

In short, if I describe then I need to make a small change in validate-number to support 100.000,00

'validate-number': [
            function (value) {
                return utils.isEmptyNoTrim(value) ||
                    !isNaN(utils.parseNumber(value)) && /^\s*-?\d*(.\d*)*(\,\d*)?\s*$/.test(value);
            },


texts: How to get product thumbnails in shipping confirmation emails

texts:
I just about have it but I can't find a way to get the thumbnail image. /template/email/order/items/shipment/default.phtml I've tried these and none have worked:

<?php echo $_item->getThumbnail(); ?>

<?php echo $this->$_item->getThumbnail()); ?>

<?php echo Mage::getModel('catalog/product_media_config')->getMediaUrl($_item->getThumbnail()); ?>

I tried adding this to the top of the page

$_product = Mage::getModel('catalog/product')
                ->setStoreId($_item->getOrder()->getStoreId())
                ->load($_item->getProductId());

And this:

<?php echo Mage::getModel('catalog/product_media_config')
                ->getMediaUrl($_product->getThumbnail()); ?>


texts: Magento 1 - Add block in footer reference

texts:
I cannot add my custom block to "footer" reference in contact page

why this works?

     <contacts_index_index>
        <reference name="bottom.container">
            <block type="core/template" name="myname" before="-" template="contacts/myname.phtml"/>
        </reference>
    </contacts_index_index>

but this does not works?

    <contacts_index_index>
        <reference name="footer">
            <block type="core/template" name="myname" before="-" template="contacts/myname.phtml"/>
        </reference>
    </contacts_index_index>


texts: Calling Grandparent Class in magento class inheritance

texts:
UPDATE:

This issue was finally tracked down as a class inheritance issue.
The original code in class becomes invalid, due to fact that the class inheritance has been updated, and the 'parent::parent' method is no longer a valid call.

Mystery solved. So simple, but somehow missed!

END UPDATE

This is more a PHP OOP related question, but I think falls within this community, since the question relates to magento and its class inheritance structure, and the way its core classes call parent methods to retain core functionality. If it is felt this does not belong here, I will happily remove this question.

I have of course googled this, and answers to this in stackexchange suggest changing the parent to place a flag to allow one to skip that class funcionality, but that woud mean having to rewrite the core classes, which is a no-go.

ref: https://stackoverflow.com/questions/8212048/parentparent-in-php
ref: https://stackoverflow.com/questions/1557608/how-do-i-get-a-php-class-constructor-to-call-its-parents-parents-constructor/1557663#1557663

As we all know magento has quite an inheritance scheme going, with inheritance running multiple classes deep.

Using the method _afterSave as an example, in the salesrule models:

CORE MODEL:

class Mage_SalesRule_Model_Rule extends Mage_Rule_Model_Abstract
{
   protected function _afterSave()
   {
       .....
       core code here (that what I want to change)
       .....
       .....
       parent::_afterSave(); (end by calling the parent class method)
       return $this;
   }
}

CORE ABSTRACT PARENT CLASS:

abstract class Mage_Core_Model_Abstract extends Varien_Object
{
    protected function _afterSave()
    {
        $this->cleanModelCache();
        Mage::dispatchEvent('model_save_after', array('object'=>$this));
        Mage::dispatchEvent($this->_eventPrefix.'_save_after', $this->_getEventData());
        return $this;
    }
}

Ok, so now I extend Mage_SalesRule_Model_Rule in my own module, and I change the functionality, (I do not want to extend Mage_Core_Model_Abstract, as i want to inherit from Mage_SalesRule_Model_Rule) (note I am not doing a rewrite, I am just extending the core class from my own module class)

Thus in my class, I cannot call parent::_afterSave(), as I do not want the core class code to run that exists in my class's parent Mage_SalesRule_Model_Rule, but I do want to call the grandparent _afterSave() method, as I do not want to copy that code into my class.

Pre PHP 5.4, the grandparent class method could be called 'statically', thus it was easy to just do Mage_Core_Model_Abstract::_afterSave() (ref : https://bugs.php.net/bug.php?id=42016 - it is not a bug!)

However, since I upgraded to PHP5.4, this causes a STRICT warning, and I do not want to disable strict warnings.

So, finally the question:

How do others overcome this issue in magento modules, if not using Mage_Core_Model_Abstract::_afterSave() ?


texts: Progress bar at right side becomes empty in checkout process

texts:
My requirement is to customize the Onepage checkout process and adding a new step between the “Payment Information” and “Review” Steps.

I have succefully added the tab but when I move to that tab the progress bar becomes empty.Please help me to solve this issue


texts: how to override mage_checkout_model_cart?

texts:
i want override mage/checkout/model/cart.php

to company/module/model/cart.php

i want to override

public function save()
{

}

how to override core checkout model


texts: Recently viewed products not showing old price for the Configurable product in Magento 2?

texts: please anyone suggest me how to do this?


texts: How Add dynamic coupon code at Newsletter subscriptions

texts:
I need to add dynamic coupon code at the confirm newsletter mail to sent subs.

I look this post: Show coupon code in newsletter subscription success message,
but don't help me.

I don't need a popup, but I need to use core newsletter subscription form

ps: I tryed this extension: https://www.magentocommerce.com/magento-connect/activated-newsletter-coupon.html and when open backend configuration show me error 500.

Thanks


texts: How to get Products which have no attribute | Magento 2

texts:
I am using Magento2. There are many products which have no attribute is_imported and is_csv_imported. I want to get and delete all these products.

Here is my custom script:

<?php
use Magento\Framework\App\Bootstrap;

require __DIR__ . '/../app/bootstrap.php';

$params = $_SERVER;

$bootstrap = Bootstrap::create(BP, $params);

$objectManager = $bootstrap->getObjectManager();

$productcollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
$productcollection->addAttributeToSelect('*');
$productcollection->addAttributeToFilter('is_imported', array('neq' => 1));
$productcollection->addAttributeToFilter('is_csv_imported', array('neq' => 1));

foreach ($productcollection as $product){
    print_r($product->getId());
}

?>


texts: Query Magento2 database to find all SKUs without managed stock set to yes

texts:
Is there a database query that I can run against my Magento 2.1.6 database to find all SKUs that have Manage Stock set to No.

I need to have ALL products set to Yes and Use Default checkbox ticked.

If there's only a handful, I can update them manually, but if there's a lot, I would prefer to update the database instead.


texts: Magento 2 Exclude specific products from catalog price rules

texts:
how can I exclude specific products from Catalog Price Rules?.

I have 3 price rules that applies to all products depending on the customer group, however I don't see anything in conditions that can exlcude products from those rules.

Greetings!


texts: Add custom file upload field on magento 2 checkout page

texts: Does anybody know how to add file upload field on magento 2 checkout page after shipping information


texts:
I'm trying to add custom fields to default Contact Us form but they are not displaying at all. I have used this procedure:
1. Edit form.phtml (inside my theme) and I put this code after Telephone:

<?php echo Mage::helper('contacts')->__('Subject') ?> *

<input name="subject" id="subject" title="<?php echo Mage::helper('contacts')->__('Subject') ?>" value="" class="required-entry input-text" type="text"/>

2.Create a custom transactional email template where I load Contact Form and then I insert
Subject: {{var data.subject}}

3.Then in System > Configuration > General > Contacts I assign a Custom Contact Form template and Save.

Nothing happens, my contact form is still the same. Any hint?
Thanks

EDIT: Procedure described in this question is correct, I was changing wrong package file in app, so check allways with path hint if you are changing correct file.


texts: Magento2: Lots of JS Errors on 2. -> Page Load

texts:
Hi Fellow Magento Users!

I have a little problem with loading Javascripts.On first pageload after a cleanup of files and upgrade:setup i experience a page that loads javascripts really slow, and there is a lot of them, but absolutely no errors.however on second load javascripts is loaded in a bit different position, they come fast but it results in JS errors like;

  dataPost.js:13 Uncaught TypeError: $.widget is not a function.

As if jquery is not loaded, however jquery.js is loaded before RequireJs starts to add scripts. And the scripts that changes their position are loaded from RequireJs.Options like minify and combine are all disabled - Aswell as caching but, if i turn this around and active minify and combine of javascripts, it will generate errors on first page load, however on second page load it will load combined resources for the scripts that is not loaded by RequireJs and it generates no errors at all - but the total amount of loaded javascripts are with this option about 146, however without combination it is only 89 scripts Does any one have a tip on how to deal with this?


texts: Dynamic Custom Options; data in orders with out normal custom options feilds

texts:
The need is that I have a guest count on a product (product A) that changes the qty of the ordered amount.  What I have done is set up a bunch of custom options for the questions based on the guest for that particular product programmatically when the product  (product A) is added to the cart.

Currently it is saving the options to the product (product A) and this is working, but there has to be a better way. Here is what I want to do better on.  As you add a guest there are a set of questions for that guest of the product.  So as I add an order, this product (product A) get a custom option guest_1_menu=>'some text' is saved to the product (product A)  and you can see this new option on the back when editing the product (product A) .  Now when I make another order the product  (product A) this time was added to the cart with 2 guests which have there options, so guest_1_menu=>'some text new value' and guest_2_menu=>'some text'.  Now when you go to look at the product in the back end you have 2 custom options.

This all works like I said, but lets say over many order someone get to 10 guests when they check out, that product (product A) would have 10 custom options.  Here is a more visual representation of what I'm doing now

Order #0001
***(product A)***
    \___ guest 1
            \___ menu
             \___ gift

The product on the back now has 2 custom options,

- guest_1_menu
- guest_1_gift

Now we take a second order

Order #0002
***(product A)***
    \___ guest 1
            \___ menu
             \___ gift
    \___ guest 2
            \___ menu
             \___ gift

The product on the back now has 4 custom options,

- guest_1_menu
- guest_1_gift
- guest_2_menu
- guest_2_gift

Now we take a third order

Order #0003
***(product A)***
    \___ guest 1
            \___ menu
             \___ gift
    \___ guest 2
            \___ menu
             \___ gift
    \___ guest 3
            \___ menu
             \___ gift

The product on the back now has 6 custom options,

- guest_1_menu
- guest_1_gift
- guest_2_menu
- guest_2_gift
- guest_3_menu
- guest_3_gift

So just to be clear, if the number of custom options are a high water mark basically. (one last order example)

Order #0004
***(product A)***
    \___ guest 1
            \___ menu
             \___ gift

The product on the back still has 6 custom options as order 3 pushed it up there,

- guest_1_menu
- guest_1_gift
- guest_2_menu
- guest_2_gift
- guest_3_menu
- guest_3_gift

SO again this works, but you can see how messy this gets, so is there a better way to attach data to an order that will show from cart to invoice?  Happy to add classes or blocks that will help, but I really don't want to have it something that can get edited from the product in the admin.  I hope this was clear.


texts: How can we enable these price category rule if any one have done this type of query then expalin step by step?

texts:
I have this type of query :-

1) buy 2 category A products & get discount 10% Discount on any B category products.
2) buy any category products total amount is 200 , you will get 10% discount.
2.1) buy any category products total amount is 300 to 500, you will get free shipping.

2.2)buy any category products total amount 500 or above, you will get free shipping & you will get 10% discount.


texts: Magento1.9 : Update order status flow for virtual products

texts:
I have a magento store where all products are virtual type, currently all order's initial status is pending and after payment success order status updated to complete (as invoice created with paid status).

I want to update this flow as following :

1) When order place (before redirecting to payment gateway) order status should be pending,

2) after payment success (redirecting back to store from payment gateway) order status should be processing,

3) and from admin I have added a custom button in order view page, so on click on it order status should be complete

How can I manage this flow in my case?


texts:
I have added additional colomns description and image  in eav_attribute_option_value table.

Which means each option of an custom attribute has its own description and image.

I have saved the attribute options for an attribute, but failed to save options's image and description please provide me a solution.

function getAddOptions($objectManager, $option, $attributeName)
{
    $eavConfig = $objectManager->create('\Magento\Eav\Model\Config');
    $attribute = $eavConfig->getAttribute('catalog_product', $attributeName);
    $status = checkExistingOptions($option, $eavConfig, $attribute);
    if (!$status) {
        $newOption['attribute_id'] = $attribute->getAttributeId();

        $newOption['value'][0][0] = $option;
        $newOption['description'][0][0] = 'nice color';

        $eavSetup = $objectManager->get('\Magento\Eav\Setup\EavSetup');
        $eavSetup->addAttributeOption($newOption);
        // $eavSetup->addAttributeDescription($descArray);
    }
}


texts:
Background :

I can able to download excel sheet with information of customer's Id , name....

Requirement :

How to get Customer's First Order id in excel ?

<?php
require_once('app/Mage.php');
umask(0);
if (!Mage::isInstalled()) {
    echo "Application is not installed yet, please complete install wizard first.";
    exit;
}
// Only for urls // Don't remove this
$_SERVER['SCRIPT_NAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_NAME']);
$_SERVER['SCRIPT_FILENAME'] = str_replace(basename(__FILE__), 'index.php', $_SERVER['SCRIPT_FILENAME']);
Mage::app('admin')->setUseSessionInUrl(false);
Mage::setIsDeveloperMode(true); ini_set('display_errors', 1); error_reporting(E_ALL);
try {
    Mage::getConfig()->init();
    Mage::app();
} catch (Exception $e) {
    Mage::printException($e);
}
ini_set('memory_limit','500M');
$customerCount = 0;
try{
    //configure the collection filters.
    $collection = Mage::getResourceModel('customer/customer_collection')
    ->addAttributeToSelect('entity_id')
    ->addAttributeToSelect('firstname');

    //Add a page size to the result set.
    $collection->setPageSize(50);
    //discover how many page the result will be.
    $pages = $collection->getLastPageNumber();
    $currentPage = 1;
    //This is the file to append the output to.
    $fp = fopen('customers.csv', 'w');
    $addedKeys = false;
    do{
         //Tell the collection which page to load.
         $collection->setCurPage($currentPage);
         $collection->load();
         foreach ($collection as $customer){
            //write the collection array as a CSV.
            $customerArray = $customer->toArray();
            $customerREquiredArray['customer ID'] = $customerArray['entity_id'];
            $customerREquiredArray['First name'] = $customerArray['firstname'];

            if($addedKeys == false){
                $keys = array_keys($customerREquiredArray);
                fputcsv($fp, $keys);
                $addedKeys = true;
            }
            //var_dump($customerArray); echo "\n\n";
            fputcsv($fp, $customerREquiredArray);
            //fwrite($fp,print_r($customerArray,true) . chr(10) );
            $customerCount++;
         }
         $currentPage++;
         //make the collection unload the data in memory so it will pick up the next page when load() is called.
         $collection->clear();
         //break; //DEBUG
         echo "Finished page $currentPage of $pages \n";
    } while ($currentPage <= $pages);
    fclose($fp);
} catch (Exception $e) {
    //$response['error'] = $e->getMessage();
    Mage::printException($e);
}
echo "Saved $customerCount customers to csv file \n";


texts: Magento 2: TAX Calculation / Approximation not correct

texts:
I have set up a TAX rate of 4%.

I've then received different orders, but I've found that the tax calculation is not correct, or better, the approximation isn't.

That's an example:

The client bought an item for the price of € 3.37.

4% should be 0.1348, but Magento just cut it off at 0.13.
The right approximation should be 0.14 instead.

Of course then the final total price is off.

How is it possible to fix it? Thank you.


texts:
I have this form and I add new text field category id, I have a table where the data is saved. Now I create new column in table cat id and I want to save the cat id text field data in the table column this is my saveAction code

 if ($data = $this->getRequest()->getPost()) {
            if (isset($_FILES['image']['name']) and (file_exists($_FILES['image']['tmp_name']))) {
                try {
                    $uploader = new Varien_File_Uploader('image');
                    $uploader->setAllowedExtensions(array('jpg', 'jpeg', 'gif', 'png')); // or pdf or anything

                    $uploader->setAllowRenameFiles(false);

                    $uploader->setFilesDispersion(false);

                    $path = Mage::getBaseDir('media') . DS . "campaign" . DS;

                    $uploader->save($path, $_FILES['image']['name']);

                    $data['image'] = $_FILES['image']['name'];
                } catch (Exception $e) {

                }
            } else {
                if (isset($data['image']['delete']) && $data['image']['delete'] == 1)
                    $data['image'] = '';
                else
                    unset($data['image']);
            }

            $model = Mage::getModel('campaign/campaign');
            $id = $this->getRequest()->getParam('id');

            if ($id) {
                $model->load($id);
            }

            $model->setData($data);

            Mage::getSingleton('adminhtml/session')->setFormData($data);
            try {
                if ($id) {
                    $model->setId($id);
                }

                $model->save();

                if (!$model->getId()) {
                    Mage::throwException(Mage::helper('campaign')->__('Error saving campaign details'));
                }

                Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('campaign')->__('Details was successfully saved.'));

                Mage::getSingleton('adminhtml/session')->setFormData(false);

                // The following line decides if it is a "save" or "save and continue"
                if ($this->getRequest()->getParam('back')) {
                    $this->_redirect('*/*/edit', array('id' => $model->getId()));
                } else {
                    $this->_redirect('*/*/');
                }
            } catch (Exception $e) {
                Mage::getSingleton('adminhtml/session')->addError($e->getMessage());
                if ($model && $model->getId()) {
                    $this->_redirect('*/*/edit', array('id' => $model->getId()));
                } else {
                    $this->_redirect('*/*/');
                }
            }
            return;
        }
        Mage::getSingleton('adminhtml/session')->addError(Mage::helper('campaign')->__('No data found to save'));
        $this->_redirect('*/*/');
    }


texts: Form Creation for Custom tab in customer dashboard Magento 2

texts: I added custom tab in customer dashboard, using customer_account.xml and i need to create form to this custom tab, if I click this custom tab, form will open in content area based on customer dashboard. So, which xml file I need to use to write a content.


texts:
I'm using the same form for a few pages.

  {{block type="core/template" name="contactForm" form_action="/contacts/index/post" template="contacts/form.phtml"}}

Is it possible to somehow detect from which page the email was sent?


texts: how to redesign magento 2.3.4 payment method list, term and condition, place order button

texts:
https://prnt.sc/u3p9fd

how to i am move term and condition and place order button after payment method list in magento 2.3.4


texts:
Amazon payments api requires to send session post variable, grand total and increment id. How to get order data in salesPlaceOrderAfter observer

class Amazon_Payments_Model_Observer extends Varien_Object
{

public function salesPlaceOrderAfter($observer)
{
    $post = Mage::app()->getRequest()->getPost();
        Mage::log('post salesPlaceOrderAfter');
        Mage::log($post);
        //$orderData = $observer->getQuote()->getData();
       $orderData = $observer->getEvent()->getOrder();
        Mage::log('orderData');
        Mage::log($orderData);
        //$checkout = Mage::getSingleton('checkout/session')->getQuote();
        //Mage::log($checkout);

    $payment_method = $post['payment']['method'];
    if($payment_method=='pay'){
        $session = $post['billing']['session'];
        $access_token = $post['billing']['access_token'];
    }

}


texts: Magento 2 PWA Installation for Already existing Magento 2 project

texts: Can any guide me how to integrate pwa for already existing magento 2 project without collapsing previous theme


texts:
TinyMCE has an very unfriendly feature for me: it escapes all accents to html entities once you switch from raw to visual and then to raw again.

I found the key that must be configured, now I would like to know the place to put the configuration for the backend editor to STOP escaping accents.

Anyone ? Thanks.


texts: As a system integrator, what is the recommended set of tests to run on each build?

texts:
To clarify, by "System Integrator" I mean, "I am working on a full Magento project, not just a module"

I am currently working with Travis and already am using composer to import all custom extensions (some private, some public).

At the time, I am dealing with 2 issues:

Magento2 tests simply break here and there
The provided tests take WAAAAAY to long to run

To fix (1) I am simply customizing phpunit.xml.dist to skip the broken tests. No big deal.

To fix (2) I am attempting to do the following:

No unit tests (both PHP and JS). Each module should have their own unit tests run in their independent repositories, the project should only use stable well-tested modules
Limit all static tests to only run on theme and local customizations via whitelists

By doing that, main static tests run in 2 min 10 sec, JS static tests run in 1 min 50 sec but still have integration and functional tests run for over an hour.

I am wondering if there is value in running all integration and functional tests or if there are some core tests that safely be skipped for a faster build.

Like, I am already skipping CodeGeneratorTest.php because it breaks out of the box, but it is pretty clear to me that there isn't really much value in testing the CodeGenerationEngine as I am obviously not messing around changing that (famous last words), any other candidates?

There is really no way of telling what is actually being tested in the whole testsuite without digging really deep in the engine .

UDPATE: we switched to completely disabling functional tests at the moment and are only running integration tests when a change to composer dependencies is detected. Pretty happy with the results so far. Still, skipping acceptance tests without really knowing what they test makes me a little nervous.


texts:
Magento Version: 2.1.7 EE Theme: Ultimo Theme - Infortis.

My product page seems to be blank when i have a price of 0.00, but if i make it 0.01+ the product page works fine.

As i need all my products to not have a price, any ideas how i can fix this?

Seems to be put on hold requiring more information but i have no idea what information you would like me to supply?


texts: How to add Cancel/Ok button within Minicart and remove popup

texts:
I want to remove the delete button that is in below screenshot

And add to button Cancel/Ok within minicart, not in popup like magneto by default functionality.
just want to add button on mincart not on popup, remove popup.

  kindly help me out!

just one thing i want add a massage of Are you sure you want to Remove
after clicking the

  Remove item

button


texts:
Brief

I'd like to add a button on the Order Create screen. I know where the core file/line number is. Is there a way to extend this document somehow without having to override the whole file? It seems counterproductive to override a 260 line document for a couple of lines of code.

File (line)

  /vendor/magento/module-sales/view/adminhtml/templates/order/create/items/grid.phtml

Insert directly after this line

<?php $block->getButtonHtml(__('Update Items and Quantities'), 'order.itemsUpdate()', 'action-secondary') ?>


texts: Coupons are applied but payment decting only one coupon in magento2

texts:
I'm using the Multiple coupons for magento2. in this module coupons are applied but amount is decting wrong. if I applied 2 coupons to the product those are applied when I pay the amount only one coupon amount is reduced.
example. product price is €239.96
I applied two coupons each one for € 30.00 total €60.00 reduced and the Grand total is €179.96
when I pay the amount is € 209,96 means only one coupon amount is dected.
below I attached the screenshot please check

in the network tab grand total and base grand total values are different


texts: Stop Magento from cleaning phone number in checkout

texts:
How can I stop Magento from removing special chars like comma from telephone number during checkout?

I looked in OnepageController.php leading to Model/type/Onepage.php but could not find where  phone number is cleaned up.


texts:
I'm not on a product page (custom module) and I have the URL of a product page.
Is it possible to get the product ID from a URL?

I checked Mage::getUrl but that seem to generate URLs - I need it the other way round.
Is there a possibility to do that? Via the rewrite table?


texts: Not displaying breadcrumbs in Contacts page

texts:
In my site, the breadcrumbs are not displaying on the Contacts page. I have added the code for breadcrumbs in contacts.xml (given below), but still not working.

<layout version="0.1.0">
<contacts_index_index translate="label">
    Contact Us Form

    <reference name="head">
        <action method="setTitle" translate="title" module="contacts">
            <title>Contact Us</title>
        </action>
    </reference>
    <reference name="breadcrumbs" as="breadcrumbs">
        <action method="addCrumb">
            <crumbName>home</crumbName>
            <crumbInfo>
                Home
                <title>Home</title>
                <link>/</link>
            </crumbInfo>
        </action>
        <action method="addCrumb">
            <crumbName>contacts</crumbName>
            <crumbInfo>
                Contact us
                <title>Contact us</title>
            </crumbInfo>
        </action>
    </reference>
    <reference name="root">
        <action method="setTemplate">
            <template>page/2columns-left.phtml</template>
        </action>
        <action method="setHeaderTitle" translate="title" module="contacts">
            <title>Contact Us</title>
        </action>
    </reference>
    <update handle="cms_menu"/>
    <reference name="content">
        <block type="core/template" name="contactForm" template="contacts/form.phtml"/>
    </reference>
</contacts_index_index>


texts:
I had an extremely strange error occur today when I added

$error_message = "error Doing Saasu Order Link";
Mage:log($error_message);
Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__($error_message));

If I comment out the Mage::log line, it works fine

Error comes up with
( ! ) Fatal error: Label 'Mage' already defined in C:\wamp\www\local_wildfire\app\code\local\Wildfiretextbooks\Saasu\Model\Saasuconnect.php on line 849
Call Stack
#   Time    Memory  Function    Location
1   0.0009  380632  {main}( )   ..\index.php:0
2   0.0094  748832  Mage::run( )    ..\index.php:80
3   0.0300  1978136 Mage_Core_Model_App->run( ) ..\Mage.php:640
4   1.2155  9668488 Mage_Core_Controller_Varien_Front->dispatch( )  ..\App.php:349
5   1.2459  10954408    Mage_Core_Controller_Varien_Router_Standard->match( )   ..\Front.php:176
6   1.2576  11581480    Mage_Core_Controller_Varien_Action->dispatch( ) ..\Standard.php:250
7   1.4137  14910232    Slink_MageSaasu_Admin_SchedulesController->runAction( ) ..\Action.php:420
8   1.4217  15034424    Slink_MageSaasu_Model_Schedules->run( ) ..\SchedulesController.php:163
9   1.4355  15384808    Inventory->execute( )   ..\Schedules.php:77
10  1.4450  15560200    Mage::getModel( )   ..\Inventory.php:53
11  1.4451  15560320    Mage_Core_Model_Config->getModelInstance( ) ..\Mage.php:432
12  1.4451  15560688    class_exists ( )    ..\Config.php:1348
13  1.4451  15561024    Varien_Autoload->autoload( )    ..\Autoload.php:0

The line that it says it crashed on is
10  1.4450  15560200    Mage::getModel( )   ..\Inventory.php:53
$wildfire_sassu_model = Mage::getModel('Wildfiretextbooks_Saasu/Saasuconnect');

It does not even call the function where the log is, however, that module is loaded.

Any explanation as to what is happening?


texts: Magento 2: Can't install or uninstall plugins in magento 2

texts:
I can not install or uninstall magento 2 plugins / modules. I have the default theme Luma, and magento 2.2.4.
I'm in developer mode. Whenever I try to install a plugin, or uninstall a plugin by SSH or by Magento backend, I get an error.

Warning: include(../public_html/generated/metadata/global.php): failed to open stream: No such file or directory in ../public_html/vendor/magento/framework/App/ObjectManager/ConfigLoader/Compiled.php on line 31
Warning: include(): Failed opening '../public_html/generated/metadata/global.php' for inclusion (include_path='../public_html/generated/code:../public_html/generated/code:../public_html/vendor/magento/zendframework1/library:.:/usr/local/php71/lib/php') in ../public_html/vendor/magento/framework/App/ObjectManager/ConfigLoader/Compiled.php on line 31
Fatal error: Uncaught TypeError Argument:  1 passed to Magento\Framework\ObjectManager\ObjectManager::configure() must be of the type array, boolean given, called in ../public_html/vendor/magento/framework/App/ObjectManager/Environment/Compiled.php on line 108 and defined in ../public_html/vendor/magento/framework/ObjectManager/ObjectManager.php:82 Stack trace: #0 ../public_html/vendor/magento/framework/App/ObjectManager/Environment/Compiled.php(108): Magento\Framework\ObjectManager\ObjectManager->configure(false) #1 ../public_html/vendor/magento/framework/App/ObjectManagerFactory.php(187): Magento\Framework\App\ObjectManager\Environment\Compiled->configureObjectManager(Object(Magento\Framework\Interception\ObjectManager\Config\Compiled), Array) #2 ../public_html/vendor/magento/framework/App/Bootstrap.php(208): Magento\Framework\App\ObjectManagerFactory->create(Array) #3 in ../public_html/vendor/magento/framework/ObjectManager/ObjectManager.php on line 82

These errors are only solved when I run bin/magento setup:di:compile. After I run that, no changes are made, my new plugin is not showing, or when uninstalling: is still showing.
I have tried cache flush/clean, setup:upgrade, permissions are 755 on generated dir. I don't know why I should run di:compile as i'm in developer mode, but more importantly: why I can not install new plugins/uninstall plugins.
What should I do?


texts: Magento 2 installation from GitHub: blank screen

texts:
I have been trying for days to install Magento 2 on a Vagrant box running
Ubuntu, Nginx & PHP 7.0.13

When I try to load the setup/installtion wizard I get a blank screen with no errors in the console or Nginx log

Does anyone know what the correct steps are or what is causing this to happen?

If I try to install via php bin/magento setup:install

php bin/magento setup:install --base-url=http://magento.dev/ \
--backend-frontname=admin \
--db-host=localhost --db-name=magento2 --db-user=root --db-password=root \
--admin-firstname=Test --admin-lastname=Test—admin-email=email@email.com \
--admin-user=admin --admin-password=password --language=en_GB \
--currency=GBP --timezone=Europe/London --use-rewrites=1

I get the following error

  [InvalidArgumentException]
  Parameter validation failed

If I try with the command on one line I get the same error:

php bin/magento setup:install --base-url=http://mage.dev --backend-frontname=admin --db-name=magento2 --db-user=root --db-password=magento2 --admin-firstname=Magento --admin-lastname=User --admin-email=user@example.com --admin-user=admin --admin-password=admin123 --language=en_US --currency=USD --timezone=America/Chicago --use-rewrites=1

  [InvalidArgumentException]
  Parameter validation failed

What is this error and do I fix it?
Why is it so difficult install Magento 2?

** UPDATE **
I've reinstalled from Magento 2 Repo Instead of using the .zip archive
but now I get the following screen

When I try to debug the request flow it looks to me like the classMap isn't getting the correct path when trying to autoload:

/home/vagrant/www/./vendor/autoload.php


texts: How to wait until text/x-magento-init has loaded the options

texts:
It seems to me that text/x-magento-init returns options async:

<script type="text/x-magento-init">
    {
        "*": {
                "component": " <?php echo "test" ?> "

        }
    }
</script>

component.js

define([
    'jquery',
    'jquery/ui'
], function ($) {
    'use strict';

return {
    check : "3",
    myVariable : "7",
    component: function(config, element) {
        console.log(config) //OUTPUTS OK AFTER 3 SECONDS
        this.myVariable = config // replaces it with undefined when called in third.js
    }
};

then in third.js where all info should be processed:

require([
        'jquery',
        'component',
        'jquery/ui'
    ],
    function($,component){

        $(document).ready(function(){
            component.component();
            console.log(component.myVariable) //undefined
            console.log(component.check)  //3

the right info is printed from component.js after being undefined.

also component.js is loaded by requirejs, in the sense that console.log(component.check) returns 3 as desired.

How to wait until config is loaded?

Question related to How to get url for static image file in Magento2 javascript files? but has progressed


texts: Magento 2 - How to remove phone number validation in adminhtml

texts:
Magento 2 I want to remove phone number validation in customer addresses in admin panel

--- Screenshot for your reference ----


texts: Modifying the layout of product options in both shopping cart page and Order review checkout section

texts:
I would like to display the product options differently  which appear:

In the shopping cart page
In the Checkout section "Order review"

Here are pictures showing what I need to do:

When we get through the checkout process, I have the same default layout in order review section.

What changes do I have to do to get the requested result?


texts: For what - conversion_user table in magento database

texts: I want to know for what it's conversion_user table in magento 1.9 database? I got that table in MySQL and it's got 3 milions records and 500MB size.. Can i empty it?


texts:
I need to prepare content and when the time is coming schedule merge on the main website. I think that I can use staging env for this purpose. But it's seems not working or I'm doing something wrong.

I'm creating new cms page on staging, I change setting at BO for staging to show this page as home page. After it I go to staging and plan merge. After merge I expect that created cms page will be home page. But nothing happens. What I'm doing wrong? How to make created cms page on staging home page on live?


texts: Success Event for Order place on Admin side

texts:
I want to know which event is used for firing when an order successfully placed by the admin.

Right know i am using an event sales_order_save_commit_after. The problem her i am facing is that while i place an order using a card and the card was not valid or something happened at gateway which resulted in cancel of order. Even if the order is cancel my code still run which shouldn't happen.

So which is the best event for Admin orders in this type of cases.


texts: Multi Select Customer Group Promotion Price Rules Not Applied

texts:
I have converted the Customer Group from Select to multi-select by following the below URL,

https://stackoverflow.com/questions/12528327/assign-customer-to-multiple-customer-groups-to-magento,

it's working fine.

My Problem is when a customer associated with more than 1 customer group then the Promotion pricing rules are not applied to that customer.

Eg. If a Customer A has a customer group General and Wholesale,
I have created a Promotion price rule for Customer Group General, then the pricing rules need to apply to the customer A,but the price rules are not applied to that Customer A(this is my problem).

If I assign Customer group as only General, then price rules are applied to Customer A.

I need if customer A has more than 1 customer group, then the Price Rules should be applied.


texts: How to activate and setup full page caching using Varnish from command line

texts:
Is there a way to activate the Varnish use using the command line, not the admin interface? In the bin/magento comand line tool there are options for cache but nothing specific for Varnish.

I am building an Ansible script that automatizes the installation and configuration of the M2EE and this step seems that has to be done manually (which I did and works well). I would prefer a command line action than changed direct values in the mySql, but maybe you have other suggestions.


texts:
Help create a block to insert view.phtml. I have a layout file that outputs to buy in one click in the right column. I need to put this block alongside a buy button.

<checkout_cart_index>
    <reference name="head">
        <action method="addCss"><stylesheet>css/oneclickorder.css</stylesheet></action>
    </reference>

    <reference name="checkout.cart.methods">
        <block type="smasoft_oneclickorder/form" name="checkout.cart.methods.oneclickorder" template="smasoft/oneclickorder/form.phtml"/>
    </reference>
</checkout_cart_index>

<!-- Show OneOrderClick form on product view page -->
<catalog_product_view>
    <reference name="head">
        <action method="addCss"><stylesheet>css/oneclickorder.css</stylesheet></action>
    </reference>
    <reference name="right">
        <block type="smasoft_oneclickorder/form" before="-" name="catalog.product.oneclickorder" template="smasoft/oneclickorder/form.phtml"/>
    </reference>

</catalog_product_view>

<smasoft_oneclickorder_index_success translate="label">
    <label>One Click Order Checkout Success</label>
    <reference name="root">
        <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
    </reference>
    <reference name="content">
        <block type="smasoft_oneclickorder/success" name="checkout.success" template="smasoft/oneclickorder/success.phtml">
            <block type="checkout/onepage_success" name="checkout.magento.success" as="magento_order_success" template="checkout/success.phtml"/>
        </block>
    </reference>
</smasoft_oneclickorder_index_success>

<oneclickorder_email_order_items>
    <block type="smasoft_oneclickorder/email_items" name="items" template="smasoft/oneclickorder/email/items.phtml">
        <block type="sales/order_invoice_totals" name="invoice_totals" template="sales/order/totals.phtml">
            <action method="setLabelProperties"><value>colspan="3" align="right" style="padding:3px 9px"</value></action>
            <action method="setValueProperties"><value>align="right" style="padding:3px 9px"</value></action>
        </block>
    </block>
</oneclickorder_email_order_items>


texts: I will migrate magento from 1 to 2, and then I will like to migragte the changes manually. I know that I can do it with The incremental migration tool, but the problem is I dont have sudo permission in the share server, because that there wont be any m2_cl_* tables to track the changes. How should I do it? can I run the migration tool every time I want to migrate the changes? or it will messed up, like it will create duplicated orders, products and so on?


texts: increase google insights Rank to improve page speed - Magento 2

texts:
I have tried different things to increase their rank on Google insights.
I have installed defer javascript extension which have solved the problem of javascript and increase the rank.
I have enabled minify HTML, CSS, and js from admin panel.
I also enabled the page speed module in php.ini for Apache for bitnami which also help me to improve it.
I have also cached the content for leverage cache through the .htaccess file.
But still, I am on 77 for mobile and 90 for the desktop.
I am getting following issue on google insights.
1: Your page has 1 blocking CSS resources. This causes a delay in rendering your page.
How can I improve this section. Any extension which optimizes the CSS?
2: Leverage browser caching for the following cacheable resources:
https://www.googletagmanager.com/gtm.js?id=GTM-WXRH9TG (15 minutes)
https://www.google-analytics.com/plugins/ua/ec.js (60 minutes)
https://www.google-analytics.com/analytics.js (2 hours)

Anything I can do about the cache of these external links?
3: On our test, your server responded in 0.28 seconds. There are many factors that can slow down your server response time.
Anything I can do about it?
There is one image which is not optimized according to Google insights but I have kept the optimized one but I still getting it in results.


texts:
I had trouble getting CSS to load, but go that fixed. However, now the admin meu items go nowhere and there are no icons. There were when I first fixed the CSS isue, but now there are just squares where the icons would be. That's minor compared to not being able to navigate anywhere. All menu links look like this:  http://rockeroffroad.com/shop/admin_bark001/admin/dashboard/index/key/e42e54314d31101d63366745ad79b35d8f7b8fd8eee3dad24486a40b39da22b1/#

Btw, should that URL be so crazy long?

Any help will be appreciated. Thanks.


texts: How to upload multiple image in admin panel grid form?

texts:
Here, I would like to upload multiple image in admin panel grid form in magento. I create images upload in admin panel grid form.
Here I attached my image upload coding.

[....]

$fieldset->addField('image', 'image', array(
            'name'      => 'image',
            'label'     => Mage::helper('magentostudy_design')->__('design Image'),
            'title'     => Mage::helper('magentostudy_design')->__('design Image'),
            'required'  => true,
            'disabled'  => $isElementDisabled
        ));
[....]

when i change multiple upload image  by using this argument. 'multiple'=> 'multiple'
Here my code:

 [....]

    $fieldset->addField('image', 'image', array(
                'name'      => 'image',
                'multiple'  => 'multiple',
                'mulitple'  => true,
                'label'     => Mage::helper('magentostudy_design')->__('design Image'),
                'title'     => Mage::helper('magentostudy_design')->__('design Image'),
                'required'  => true,
                'disabled'  => $isElementDisabled
            ));
    [....]

And also i put name value as array[] just like this 'name'      => 'image[]',.
Nope, i am not getting any result, still single image will be uploaded. How to create multiple image upload concept in magento. Can any one Help me to solve this problem.Please guide me.


texts: Get product's final price with its selected custom option on add to cart

texts:
I want just added product’s final price on “add to cart after” event. Here final price is in a term of, price with selected options (configured option, custom options). So how can I get this price?

I tried following codes to take final price but any of this is not working:

Observer.php

public function addtocartAfter($observer)
{
  $quote_item= Mage::getSingleton('checkout/session')->getQuote()->getItemByProduct($observer->getEvent()->getProduct());
}

Or

   public function addtocartAfter($observer)
    {
       $quote =  Mage::helper('checkout/cart')->getCart()->getQuote();
       $quote_item  = Mage::getModel('sales/quote_item')->load($quote->getItemByProduct($observer->getEvent()->getProduct())->getId());
    }

But when I tried to get price like : $quote_item->getPrice() .I got product’s price,without selected options's price.


texts: Why are the Input fields in my payment method all disabled

texts:
During the process of testing a new Payment module I run into the problem, that all input fields of this module were disabled.

Apparently this happens as part of the payment.init() function of magento.

Why does Magento do this, and how can I solve this?


texts: Magento 2 Form Field Array (Advance system configuration option)

texts:
Recently I worked on advance system config form field in Magento 2. I checked Braintree payment method for reference.

When I saved a value, it showing following error:

  Something went wrong while saving this configuration: Notice: Array to
  string conversion in
  E:\wamp\www\magento2\app\code\Magento\Config\Model\Resource\Config\Data.php
  on line 38

After print $object->getValue() array is printed with error:

and

(click screenshots to enlarge)


texts:
I have to implement some functionality that requires different observers to "observe" different events. No problem here.
All the actions performed by these observers are basically the same, they just depend on a key (string). Let's call it 'something'.
What I've done so far, is to create a "parent" observer (abstract) and have child classes that extend the abstract observer and just implement a method:

public function getSomething(){
    return 'some_value';
}

In the abstract observer I have a method:

public function doSomeAction($observer){
   $something = $this->getSomething();
   //do magic with $something.
}

What I want to achieve, for extensibility reasons is to be able to pass to the event through config.xml this key so I won't need a new observer class and just be able to call the abstract observer (that is not going to be abstract anymore) with that parameter.
Something like:

<some_event_name>
    <observers>
        <unique_observer_key>
            <type>singleton</type>
            <class>my/observer</class>
            <method>doSomeAction</method>
            <something>some_value</something><!-- need to pass this -->
        </unique_observer_key>
    <observers>
</some_event_name>

[Edit]
I found that you can pass some arguments in the event xml like this:

<some_event_name>
    <observers>
        <unique_observer_key>
            <type>singleton</type>
            <class>my/observer</class>
            <method>doSomeAction</method>
            <args>
                <something>some_value</something>
            </args>
        </unique_observer_key>
    <observers>
</some_event_name>

I deleted the question after finding this. But I undeleted it after further digging because those parameters are USELESS. They are never used or passed to the class instance that handles the event.
Any ideas on how should I tackle this?


texts: Magento Apply Tax on Original Product price instead of discounted price

texts:
Using Magento Enterprice ver. 1.12.0.0

Prices are coming including Tax.
I want the Tax to be calculated on the original product price instead of the discounted price ( in case of catalog price rules)
For example:

Original Product Price ( including Tax) : $110
Catalog price rule discount: 40%
Tax : 10%

Currently the Tax is being calculated on the discounted price, so the final price of the product after Discount and tax is:

$110 - (40% Discount on $110) = $66

(So tax is calculated like 10% of discount price)

But what I want is, if a catalog price rule is applied to a product , Tax should be calculated on the original price of the product , and not the discounted price. So it should be like:

$100  + (10% Tax on $100) - (40% of $100) = $70

Note: Prices are coming including Taxes


texts: How to make Magento 2 accessible using different url Domain without creating Multi Website?

texts:
So using other PHP frameworks such as Laravel and CI, I can point my virtual host to the same project folder and access it with a different domain. However using Magento 2 the base URL is defined in the database and to access it with multiple domains we need to create multiple websites, I just need to access it from multiple domains without creating multiple website, how to do this?

For example:

I can access the same Magento 2 site using:

1. my.gov
2. mine.gov

if I go to another page:

1. my.gov/customer/account
2. mine.gov/customer/account

it won't change the base URL (without redirecting it)


texts: Remove Title suffix from Product Page only

texts: How do i remove title suffix only from product page. My current Page title is like [Product Name] - [Website Address] here i want to remove website address only from product page which means it should appear in all rest of the pages. Can anyone please help me on this. Thanks in Advance.


texts: How to fix mysql error 1031 - Table storage engine for 'catalog_product_relation' doesn't have this option?

texts:
I'm trying to make a new development version of our Magento store.
I made a clean install of El Capitan and got apache running with PHP, Mysql(version 5.7.10) etc. I also have phpmyadmin running and created a database for Magento. However, when I try to import the backup from our production site I get the error:

ERROR 1031 (HY000) at line 291001: Table storage engine for 'catalog_product_relation' doesn't have this option

I tried to import the .sql file through the Terminal with the command:

mysql -h localhost -u <user> -D <database> -p < <file>

I'm lost here. Google for quit some time but couldn't find the solution.
I'm using the same engine as in the production databse.

Anyone have any idea's?


texts:
I've noticed a strange random JS error on onepagecheckout. Randomly I read this error in console and executions of submit order stops

>   POST /onestepcheckout/index/savePost/ 503 (OK)  send @
> ma.jq.slide.js:4  f.extend.ajax @ ma.jq.slide.js:4
>   $.widget._placeOrder @ opcheckout.js:418(   anonymous function) @
> jquery-ui.js:401  $.widget._save @ opcheckout.js:569  (anonymous
> function) @ jquery-ui.js:401  (anonymous function) @ opcheckout.js:105
>   f.event.dispatch @ ma.jq.slide.js:3     h.handle.i @ ma.jq.slide.js:3


texts: Magento under PHP 5.4 Webserver - fatal: getFrontNameByRoute() on non-object

texts:
Has anyone managed to get Magento running under PHP 5.4 with the built-in web server?  I have used the HTRouter PHAR to mimic .htaccess rules - but so far I'm coming up empty, all roads at the moment lead to

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


texts: addFieldToFilter() 'OR' query on non EAV data doing something odd

texts:
I am modifying the Magento search results to include matching categories, pages and blog posts (from the free version of Neotheme nBlog).  Whilst the categories and pages are working just fine there is something very odd going on with the blog posts. The posts appear to be stored in a flat, non-EAV, table.

When I do this, searching for "test":

$needleSearch = "test";
$posts = Mage::getModel("neotheme_blog/post")
                ->setStoreId($storeId)
                ->getCollection()
                ->addStoreFilter()
                ->addStatusFilter(NeoTheme_Blog_Model_Post::STATUS_ACTIVE)
                ->addPublishFilter()
                ->addFieldToFilter(
                    array(
                        array("attribute"=>"title","like"=>$needleSearch),
                        array("attribute"=>"author","like"=>$needleSearch),
                        array("attribute"=>"summary","like"=>$needleSearch)
                    )
                  ) //OR BIT
                ;

The resulting SELECT query ends up with this in the middle:

((`title`.`%test%` = '') OR (`author`.`%test%` = '') OR (`summary`.`%test%` = ''))

The nested array for the OR works fine for the EAV (categories and pages).

This also produces the same result:

            ->addFieldToFilter(
                    array(
                        array("title","like"=>$needleSearch),
                        array("author","like"=>$needleSearch),
                        array("summary","like"=>$needleSearch)
                    )
             )

Putting array() around the like bit ends with the SQL query showing

...(`title`.`array` = '') OR...

A single LIKE works:

$posts = Mage::getModel("neotheme_blog/post")
                ->setStoreId($storeId)
                ->getCollection()
                ->addStoreFilter()
                ->addFieldToFilter( 'title', array('like'=>$needleSearch) )
;

I was wondering if anyone had any idea of what might be going on? I can't find an override of addFieldToFilter() in the module.

Thanks


texts: Is it possible to check that is shipping in on one address or multiple shipping?

texts: In magento 2 Is it possible to check in cart page that I am on multiple shipping or have one address? I tried with $quote->isMultipleShippingAddresses() but it is not working properly for my requirements. Thanks in advance.


texts: Apply custom discount in grand total in create order magento admin

texts:
i want to apply custom discount on grand total (without coupons) in create order section in magento admin.

i have added 2 lines code for check in this file
app\code\core\Mage\Adminhtml\Block\Sales\Order\Create\Items\Grid.php

in function

public function getSubtotal()
    {

        if ($this->displayTotalsIncludeTax()) {
            if ($address->getSubtotalInclTax()) {

                return $address->getSubtotalInclTax();

            }

            return $address->getSubtotal()+$address->getTaxAmount();
        } else {
             $address->setDiscountAmount(-(400));
     $address->setDiscountDescription('Custom Discount');

     $address->save();
     return $address->getSubtotal();
        }
        return false;
    }

but it is not only applied on subtotal of products not on grand total

Need help to find correct function.


texts: How to Invalidate Magento 2's Specific Cache using CACHE_TAG

texts: I want to invalidate particular cache tags when admin saves an attribute. How should I do it.


texts:
I am trying to run the priceCalculation test from Ecomdev_PHPUnit manual (http://www.ecomdev.org/wp-content/uploads/2011/05/EcomDev_PHPUnit-0.2.0-Manual.pdf) but I get the following error:

PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`project-XXXX_phpunit`.`catalog_product_entity`, CONSTRAINT `FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID` FOREIGN KEY (`attribute_set_id`) REFERENCES `eav_attribute_set` (`attribu)' in /var/www/XXXX/public_html/lib/Zend/Db/Statement/Pdo.php:228

I've tried changing

eav:
  catalog_product:
    - entity_id: 1
      type_id: simple
      sku: book
      name: Book
      short_description: Book
      description: Book
      url_key: book

to:

eav:
  catalog_product:
    - entity_id: 1
      attribute_set_id: 1
      type_id: simple
      sku: book
      name: Book
      short_description: Book
      description: Book
      url_key: book

but then $product->getPrice() returns NULL and $product->getFinalPrice() returns 0.

Does anyone have any idea what I could be doing wrong or might point me in the right direction? Any help would be very much appreciated.


texts: How to get image from image uploader file path and bind in custom collection? Magento 2

texts:
I have created custom image uploader to upload category icon. I also created custom model and controller for the same.

After click on save button image will save in pub/static folder successfully.

Now, I want to get that image in frontend. How to done it?


texts: Magento 1.9 - Not arrive email of Subscription Success to Newsletter

texts:
I have a problem about arrive of email of subscription success of Newsletter in Magento. Email of guest is recorded in backend, but not arrive email of subscription success. Why this?
I tried to edit action of form of subscribe-home.phtml and type of block, but without success.

Thanks.


texts: how do i add a static block to the short description

texts:
i am trying to add a static block of text to the short description of the product page.  i have tried the short code and a couple of other methods.  i am able to get the static block to work on a regular cms page but when i try to add it to the short description area it doesn't work.

i have tried the following but not sure i have the right reference name for the short description, product.info might be for a different section then the short description.


texts: We have an online store in Canada and have been doing pretty well with a steadily increasing customer coming a lot from google. When we search for related products in www.google.ca, we are pretty much always on the first page of the organic results. We have decided about 3 months ago to create a second website in our magento (this one is for US customers and is a different domain). However we noticed that we do not have any traffic on google for the new domain. Does anyone have any clues or links where we can look into SEO when we have mutiple website on magento?


texts:
When I am trying to use the code

Mage::getModel('catalog/product')->loadByAttribute('sku', $sku2)->getProductUrl();

in my cart page i am getting the error as

Fatal Error: Call to a member function getProductUrl() in boolean

Can anyone kindly tell me why am I getting this.


texts: Plus, Minus, automatic cart update on Magento 2.3.3

texts:
I have normal magento 2.3.3 which has the default mini cart as shown below.

And in the above pic by default the quantity as to be manually entered and updated the cart on click.

But I want a mini cart that should have a plus and minus symbol, with synchronous cart update i.e without clicking update cart.

The example has been shown below.

Thanks for the answers in advance.


texts: How to use module as service in magento 2?

texts: I have to call external API from each module and I want to make the external API as one module. It will be like service for my magento application. How create it. I don't think I need controller for this. I just need to able to call the API form every module I create. Also I to inject it to each module?


texts:
Is there a way to retrieve the tax rules in magento via soap?

If is not possible I think to create a csv with the Tax rates and upload with the import, but in automatic way... is it possible?

Someone has already done something similar?

Moreover I need to do it into a project in vb.net. but if someone has done something similar in php or other languages it can be usefull anyway


texts: Reload page when deleting a product from mini-cart

texts:
I was trying to make an script to reload the page when i delete a product from mini-cart.
The reason is because when i delete a product from it, if i am on the onestepcheckout, my summary don´t get reloaded, so i need to reload the full page to get again the price and the new shipping costs.

I see that btn-closeappear on default.phtml on sns_ajaxcart, but with this sencente, i dont know what i have to do the reload after the onclick makes the changes on the cart.

This is my Element

<a href="<?php echo $this->getDeleteUrl() ?>" title="<?php echo $this->__('Remove This Item') ?>" onclick="return confirm('<?php echo $this->__('Are you sure you would like to remove this item from the shopping cart?') ?>');" class="btn-remove"><?php //echo $this->__('Remove This Item') ?>

Any idea?


texts: Custom Shipping Carrier Not Showing Up For getCarriers Method

texts:
I have created a custom shipping module with a custom carrier, however, the custom carrier is not showing up when grabbing the carriers... To Grab the carriers I am using the following snippet

$validCarriers = Mage::getModel('sales/order_shipment_api')->getCarriers($order->getIncrementId());

I define my custom carrier with the following xml

<default>
    <carriers>
        <vmr_customrate>
            <active>1</active>
            <model>vmr_shipping/carrier_customrate</model>
            <title>Shipping Options</title>
            <name>Default Rate</name>
        </vmr_customrate>
    </carriers>
</default>

Any ideas on what I might be doing wrong?


texts: Varnish and Cloudflare inner page setting for First Time Byte

texts:
I optimized my site and according to webpage test its very good. However if i check homepage im getting A mark for First Byte Time if i check an inner page than its F.

Home:

http://www.webpagetest.org/result/150209_3Q_4NX/

Inner:

http://www.webpagetest.org/result/150209_ZP_4PD/1/performance_optimization/#first_byte_time

When i was working on the home page and got the A result from F i didnt make change on a specified file but i adjusted CSS,JS Merge,Complier. Is it possible that these configuration only applied to home page that i should change or how can i get this result.

Thank you


texts: getting 500 error when accessing magento using custom host file

texts:
I have a production instance of Magento 1.9 (www.example.com), and I have a test instance that is running on 1.1.1.1 server.

In windows, I have edited my host file on my computer like below:

1.1.1.1 example.com

I am now getting HTTP ERROR 500 when I try to browse the test instance by going to example.com


texts: How to remove 'Edit' link from shopping cart

texts:
We are trying to remove the "edit" link from the shopping cart for our install.   From the searching we have done so far, we have been directed to edit the default.phtml file for our theme.

We have done this however the edit button remains.

We are using Magento CE 1.9.3.1

The part we have commented out/deleted is

<a href="<?php echo $this->getConfigureUrl() ?>" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Edit item parameters')) ?>"><?php echo $this->__('Edit') ?>

Does anyone know a way this can be achieved?


texts: set custom shipping amount programmatically in Magento2

texts:
I am trying to set the custom shipping amount to quote or order without shipping method. Main thing is that shipping amount have to be stored in the database.
Please help me for the same .. My shipping amount calculation is happening in checkout page.


texts: PWA url is not accessible from my machine

texts:
I have configured the PWA on local by following https://magento-research.github.io/pwa-studio/venia-pwa-concept/setup/ and PWA URL is generated successfully and working fine on my local machine. When I followed the same steps on server then it generate url for PWA successfully but when I try to access this URL from my machine’s browser then it shows 404 (not working). It seems this url can be access only on the machine on which pwa is configured i.e. URL is not public.
Do we need to configure or follow some additional steps?
Thanks in advance.


texts: Magento 2: How to display captcha on Custom Form?

texts:
I'm using Magento 2 CE Version 2.1.0.

I have created custom form, which is not listed on Stores -> Configuration -> Customers -> Customer Configuration -> CAPTCHA

I would like to add my newly created custom form in to "Forms" list, so Captcha also displayed on that.


texts: M2 How to use URL parameter passing to select store view

texts:
We are setting multi language with different store view. In the launching page there are links to redirect to different store views.

However the __store=storeview parameter seems cannot write to cookie so after jumping several pages will switch to default store view.

Is there any way to resolve this issue?


texts:
I'm creating my first module which has been going well, I've managed to create the controller, block and route and can access the page.

I'm now trying to perform an ajax query and return some product data but this is where I'm now struggiling, I've got the following files:

<?php

namespace MoudleName\ProductSelector\Controller\Ajax;

use \Magento\Backend\Block\Template\Context;
use \Magento\Framework\Controller\Result\JsonFactory;
use \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;

class Index extends \Magento\Framework\App\Action\Action
{
    protected $resultJsonFactory;
    protected $_productCollectionFactory;

    public function __construct($context, $resultJsonFactory, $productCollectionFactory) {

        $this->resultJsonFactory = $resultJsonFactory;
        $this->_productCollectionFactory = $productCollectionFactory;
        parent::__construct($context);

    }

    public function execute()
    {
        $result = $this->resultJsonFactory->create();

        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->setPageSize(3); // fetching only 3 products

        if ($this->getRequest()->isAjax())
        {
            return $result->setData($collection);
        }
    }
}

This is the Ajax query:

$('.ajax-query').on('click', function (event) {
    event.preventDefault();

    $.ajax({
        url: "/productselector/ajax/index",
        cache: false,
        dataType: "json",
        success: function(data){
            console.log(data);
        }
    });
});

But I just get a 500 error and in the logs I'm getting the following error:

3382#3382: *5889 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Uncaught ArgumentCountError: Too few arguments to function ModuleName\ProductSelector\Controller\Ajax\Index::__construct(), 2 passed in /var/www/generated/code/ModuleName/ProductSelector/Controller/Ajax/index/Interceptor.php on line 14 and exactly 3 expected in /var/www/app/code/ModuleName/ProductSelector/Controller/Ajax/index.php:14

If anyone can shed any light on this it'd be great.

Thanks


texts: What is use case to for directly calling new in Magento2

texts:
I know you should now init object using new keyword as it surpasses the DI

But in few cases in core code is have observed the use of new keyword like in class module-catalog/Helper/Product

Do any one know what is difference b/w when you do

 if (is_array($buyRequest)) {
            $buyRequest = new \Magento\Framework\DataObject($buyRequest);
        }

VS

when you create its object using constructor and use setData()

Looking difference in case of use why and When you should NEW and when should you call Via DI .


texts:
For open minicart on click i wrote:

but there is a problem in script jquery.
If i go down with the scroll, and then i go up, the script not work.
What the problem?


texts: Custom folder not possible to open under magento

texts:
I have magento installed under my server, and I have created some custom folder and uploaded .php files there, but when I want to open that file from the url I get magento 404 page error. Those files have nothing to do with magento and I created that folder for something else. However when I upload .html file inside that folder it opens without problem.

for example:

http://example.com/folder/file.php    dont work
http://example.com/folder/test.html   work

Is this some kind of magento block or its server related?

Thanks.


texts: Magento 2.1.3 EE special price not showing

texts:
I am having big problems with special price after updating from 2.0.7 to Magento 2.1.3 Enterprise.

Steps:

install a Magento 2.1.3 EE vanilla with sample data
create a product with regular price
edit that product and add a special price

Expected:

you should see the special price being shown on the frontend

Actual:

you can't see the special price.

I am suspecting the Staging modules are not working properly.
Do you know any known issues with this ?

Thanks in advanced!


texts:
I'm getting the next error but I don't know what does it cause or why does this happens:

[2018-01-11 16:08:25] main.CRITICAL: Notice: Array to string conversion in /home/ebj8qtas/public_html/vendor/magento/module-catalog/Block/Product/View/Attributes.php on line 88 [] []


texts: Magento 1.9.2.2 - PATCH 9767 can't be applied

texts:
Hi I am having an issue with patch 9767 here are the errors I am getting, can anyone suggest what would be the issue?

We do not use downloader which is why they are failing but as for the other errors I am unsure? How can I get this patch to successfully apply?

checking file app/etc/config.xml
Hunk #1 FAILED at 141 (different line endings).
1 out of 1 hunk FAILED
checking file app/locale/en_US/Mage_Adminhtml.csv
Hunk #1 FAILED at 1287.
1 out of 1 hunk FAILED
checking file app/locale/en_US/Mage_Core.csv
Hunk #1 FAILED at 407.
1 out of 1 hunk FAILED

checking file app/locale/en_US/Mage_XmlConnect.csv
can't find file to patch at input line 1020
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git downloader/Maged/Connect.php downloader/Maged/Connect.php
|index 5c4faf6..1535a4a 100644
|--- downloader/Maged/Connect.php
|+++ downloader/Maged/Connect.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
3 out of 3 hunks ignored
can't find file to patch at input line 1052
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git downloader/Maged/Controller.php downloader/Maged/Controller.php
|index 84a0184..bef60c0 100644
|--- downloader/Maged/Controller.php
|+++ downloader/Maged/Controller.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
can't find file to patch at input line 1115
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git downloader/Maged/Model/Session.php downloader/Maged/Model/Session.php
|index 8fb1a03..1cc5e56 100644
|--- downloader/Maged/Model/Session.php
|+++ downloader/Maged/Model/Session.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
2 out of 2 hunks ignored
checking file js/lib/jquery/jquery-1.12.0.js
checking file js/lib/jquery/jquery-1.12.0.min.js
checking file js/lib/jquery/jquery-1.12.0.min.map
checking file js/varien/payment.js
checking file skin/frontend/base/default/js/opcheckout.js
Hunk #1 succeeded at 711 (offset 27 lines).


texts: Magento 1.9 Import Product with CSV but with Dynamic Product names

texts:
I need to Import Product Using CSV
But CSV does not have Product name column

so Need to create product names dynamic from products different attribute combination like type, color, fabric, etc.
if name is already exist need to re-order attribute combination and create new name.

i have values in csv like this for one product , its for  saree

Supplier Name = some Supplier
Design No(SKU) = 22389
OCCASION = Party Wear
STYLE = N/a
Saree FABRIC = chiffon
Blouse Fabric = Raw Silk
TYPE = REGIONAL
WORK = designer cut paste work, zari
SAREE COLOR = pink
BLOUSE COLOR =   pink
TIME TO DISPATCHED = 3 Days
SAREE LENGTH = 5.5 mtr
BLOUSE LENGTH = 0.8mtr
WEIGHT   = 1kg
MRP  SELLING PRICE

so i need to use OCCASION, Saree FABRIC, TYPE, SAREE COLOR, WORK

please advise me how i can achieve this.

every help appreciated.


texts:
I have a datepicker in my site which formats the time in the current locale. So the time gets sent to the server in d/MM/yy-format.

The locale on the frontend is determined by Magento\Framework\Stdlib\DateTime\TimezoneInterface::getDateFormat().

Now how can I convert this date to a database-friendly datetime (YYYY-MM-DD) or at least to a timestamp of some sort?

So basically I'm looking for a clean generic approach on how to convert a localized date to a timestamp.

I've tried all kind of things but none seemed to work.


texts: How to show product category description below list of products?

texts:
I was wondering how to make my category description visible at the product category page?

Because I´ve wrote much of content, but it doesen´t appear on the product category sites. I want it to be shown below the list of products.


texts: Move the "action nav-toggle" block into the "header.panel" on Magento 2

texts:
I've done a new magento 2 theme, using same files from luma theme, with blank parent theme. Now what I'm trying to do, is to move the "action nav-toggle" element, basic the hamburger toggle icon on mobile, into the "header.panel" destination. What I can't do, is find the right name for the "action nav-toggle" so I can do the right code, I have already tried:

<move element="toggle.nav" destination="header.panel" before="-" />
<move element="toggle-nav" destination="header.panel" before="-" />
<move element="nav-toggle" destination="header.panel" before="-" />
<move element="nav.toggle" destination="header.panel" before="-" />
<move element="action.nav-toggle" destination="header.panel" before="-" />
<move element="action.nav.toggle" destination="header.panel" before="-" />

but non of them works, any idea what it might be?


texts: How to display price for out of stock products in magento2

texts:
How to display the price for out of stock product (configurable type) in magento2.

I also refer to these links: Magento2: show price for out of stock configurable products.

Magento 2 : How To Show Price of "out of stock" Products

But not working

How to do that.

Thanks.


texts: How to create credit memo subtotal & grandtotal should be roundprice in magento 2.Here is the images for reference.


texts: Restful API working in postman, C# not Working [Magento Integration]

texts:
I am integrating with Magento 2, using RESTful APIs. When I use postman, it works like charm, while in C# code, it returns "Unauthorized 401" exception.

However, It was working in C# code earlier, but suddenly it stopped working.

I have tried every way, I tried (WebRequest, HTTPClient & RESTsharp) the same exception returned.

Also, I am using Fiddler 4 to catch & match the requests, I used Fiddler to C# plugins to extract C# code, also I used the RESTsharp Code of Postman same exception returned.

The remote server returned an error: (401) Unauthorized.

       //Calls request functions sequentially.
        private string MakeRequests()
        {
            HttpWebResponse response;

            if (Request_hatolna_co(out response))
            {
                //Success, possibly uses response.

                string responseText = ReadResponse(response);
                response.Close();
                return responseText;
            }
            else
            {
                //Failure, cannot use response.
                return "";
            }
        }

        private static string ReadResponse(HttpWebResponse response)
        {
            using (Stream responseStream = response.GetResponseStream())
            {
                Stream streamToRead = responseStream;
                if (response.ContentEncoding.ToLower().Contains("gzip"))
                {
                    streamToRead = new GZipStream(streamToRead, CompressionMode.Decompress);
                }
                else if (response.ContentEncoding.ToLower().Contains("deflate"))
                {
                    streamToRead = new DeflateStream(streamToRead, CompressionMode.Decompress);
                }

                using (StreamReader streamReader = new StreamReader(streamToRead, Encoding.UTF8))
                {
                    return streamReader.ReadToEnd();
                }
            }
        }

        private bool Request_hatolna_co(out HttpWebResponse response)
        {
            response = null;

            try
            {
                //Create a request to URL.
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create("http://MAGENTO.co/index.php/rest//V1/orders/items?searchCriteria[filter_groups][0][filters][0][field]=item_id&searchCriteria[filter_groups][0][filters][0][value]=1");

                //Set request headers.
                request.KeepAlive = true;
                request.Headers.Set(HttpRequestHeader.Authorization, "Bearer xxxxxxxxxxxxxxxxxxxxxx");
                request.Headers.Add("Postman-Token", @"1181fa03-4dda-ae84-fd31-9d6fbd035614");
                request.Headers.Set(HttpRequestHeader.CacheControl, "no-cache");
                request.UserAgent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36";
                request.ContentType = "application/json";
                request.Accept = "*/*";
                request.Headers.Set(HttpRequestHeader.AcceptEncoding, "gzip, deflate");
                request.Headers.Set(HttpRequestHeader.AcceptLanguage, "en-US,en;q=0.9,ar;q=0.8,la;q=0.7");
                request.Headers.Set(HttpRequestHeader.Cookie, @"store=default; private_content_version=f16533d4f181d42a1b3f386fa6d2cdf1");

                //Get response to request.
                response = (HttpWebResponse)request.GetResponse();
            }
            catch (WebException e)
            {
                //ProtocolError indicates a valid HTTP response, but with a non-200 status code (e.g. 304 Not Modified, 404 Not Found)
                if (e.Status == WebExceptionStatus.ProtocolError) response = (HttpWebResponse)e.Response;
                else return false;
            }
            catch (Exception)
            {
                if (response != null) response.Close();
                return false;
            }

            return true;
        }


texts: Error in Cron with Directoy list - Magento 2.2.7

texts:
I moved Magento 2.2.7 from one host to another. I moved it myself. Everything worked except the cron. I installed cron using magento cron command.

Now every 15 min. cron is running and sending me a mail. Below is the mail subject and mail content. Is this correct or something is wrong with the cron.

Email Subject:

Cron <rbhomroh@cs-mum-1> /opt/alt/php71/usr/bin/php /home/rbhomroh/public_html/bin/magento cron:run 2>&1 | grep -v "Ran jobs by schedule" >> /home/rbhomroh/public_html/var/log/magento.cron.log* * * * * /opt/alt/php71/usr/bin/php /home/rbhomroh/public_html/update/cron.php >> /home/rbhomroh/public_html/var/log/update.cron.log* * * * * /opt/alt/php71/usr/bin/php /home/rbhomroh/public_html/bin/magento setup:cron:run >> /home/rbhomroh/public_html/var/log/setup.cron.log#~ MAGENTO END 20c7f3f92a734843b2f4781ef0ebc235

Email body content:

grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: access-logs: Is a directory
grep: bin: Is a directory
grep: etc: Is a directory
grep: logs: Is a directory
grep: mail: Is a directory
grep: public_ftp: Is a directory
grep: public_html: Is a directory
grep: ssl: Is a directory
grep: tmp: Is a directory
grep: www: Is a directory
grep: setup:cron:run: No such file or directory
grep: MAGENTO: No such file or directory
grep: END: No such file or directory
grep: 20c7f3f92a734843b2f4781ef0ebc235: No such file or directory

Please suggest if this is correct or some issue with the cron.

Regards,
Niraj


texts: How to log custom index table index_event with method logEvent()

texts:
I want to add a entry to the table "index_event" via Mage_Index_Model_Indexer's Method logEvent.

The custom indexer is from a 3rd party module called GroupsCatalog2 by Vinai (Link: https://github.com/Vinai/groupscatalog2) and we want to utilize it with the Hackathon module AsyncIndex (Link: https://github.com/magento-hackathon/AsyncIndex).

Problem is, that AsyncIndex does not recognize the index of the groupscatalog2 module has to be rebuild and therefore is being ignored. But the groupscatalog2 module uses its own index tables and works with it.

I am now trying to patch the groupscatalog2 module to have it write the changes (or anything) to the magento index table aswell so AsyncIndex may pick it up.

Progress:

/**
     * Adds the to be reindex data also to the magento table 'index_events'
     *
     * @var $chunked array
     */
    private function insertToMagentoIndexTable($chunked)
    {
        //Create dummy model, either catalog or product model
        $entity = str_replace('_', '/', $this->_getEntityTypeCode());
        /** @var $dummyModel Mage_Catalog_Model_Product | Mage_Catalog_Model_Category */
        $dummyModel = Mage::getModel($entity);

        /** @var $indexer Mage_Index_Model_Indexer */
        $indexer = Mage::getSingleton('index/indexer');
        $processTable = $this->getTable('index/process_event');

        foreach ($chunked as $chunkData) {
            $entityId = $chunkData['catalog_entity_id'];

            $dummyModel->setId($entityId);

//            $indexer->logEvent($dummyModel, $this->_mainTable, 'save');
            $indexer->logEvent($dummyModel, $dummyModel->getResource()->getType(), Mage_Index_Model_Event::TYPE_SAVE, FALSE);

            $x = 1;
        }
    }

which I added to the method ``_insertIndexRecordsIfMinChunkSizeReached``` of the groupscatalog2 module. (Right after the module will repopulate its own index tables)

The logEvent() call is the problem here as I dont really understand what I can throw at it to have it working.

Any suggestions?


texts: Random product collection from custom module extends Mage_Catalog_Block_Product_List not working

texts:
This code is not working

class My_Module_Block_New_New extends Mage_Catalog_Block_Product_List {
...
protected function _getProductCollection()
{
    if (is_null($this->_productCollection)) {
        $collection = Mage::getResourceModel('catalog/product_collection');
        Mage::getModel('catalog/layer')->prepareProductCollection($collection);

        $collection->addAttributeToFilter('newproduct', 1)
                   ->setPage(1, $this->getProductsCount())->load()
                   ->addStoreFilter()
                   ->getSelect()->order(new Zend_Db_Expr('RAND()'));

        echo $collection->getSelect();

        $this->_productCollection = $collection;
    }
    return $this->_productCollection;
}

echo $collection->getSelect();

SELECT 1 AS `status`, `e`.`entity_id`, `e`.`type_id`, `e`.`attribute_set_id`, `e`.`name`, `e`.`description`, `e`.`short_description`, `e`.`price`, `e`.`special_price`, `e`.`special_from_date`, `e`.`special_to_date`, `e`.`weight`, `e`.`manufacturer`, `e`.`manufacturer_value`, `e`.`small_image`, `e`.`thumbnail`, `e`.`news_from_date`, `e`.`news_to_date`, `e`.`tax_class_id`, `e`.`url_key`, `e`.`required_options`, `e`.`image_label`, `e`.`small_image_label`, `e`.`thumbnail_label`, `e`.`price_type`, `e`.`weight_type`, `e`.`price_view`, `e`.`shipment_type`, `e`.`links_purchased_separately`, `e`.`links_exist`, `e`.`is_imported`, `e`.`gammes`, `e`.`gammes_value`, `e`.`ean`, `e`.`delivery_time`, `e`.`inchoo_featured_product`, `e`.`newproduct`, `e`.`coup_de_coeur`, `e`.`contenance`, `e`.`prix_salon`, `e`.`promo_du_mois`, `e`.`volume_weight`, `e`.`code_video`, `e`.`msrp_enabled`, `e`.`msrp_display_actual_price_type`, `e`.`msrp`, `price_index`.`price`, `price_index`.`tax_class_id`, `price_index`.`final_price`, IF(price_index.tier_price IS NOT NULL, LEAST(price_index.min_price, price_index.tier_price), price_index.min_price) AS `minimal_price`, `price_index`.`min_price`, `price_index`.`max_price`, `price_index`.`tier_price`, `cat_index`.`position` AS `cat_index_position` FROM `catalog_product_flat_1` AS `e` INNER JOIN `catalog_product_index_price` AS `price_index` ON price_index.entity_id = e.entity_id AND price_index.website_id = '1' AND price_index.customer_group_id = 0 INNER JOIN `catalog_category_product_index` AS `cat_index` ON cat_index.product_id=e.entity_id AND cat_index.store_id='1' AND cat_index.visibility IN(2, 4) AND cat_index.category_id = '3' WHERE (e.newproduct = '1') ORDER BY RAND() LIMIT 3

Based on others topics getSelect()->order(new Zend_Db_Expr('RAND()')) should work but not in my case, what am i doing wrong ?!

Thx

EDIT
This code is working

$collection->getSelect()->order('rand()');
$collection->addStoreFilter();
$collection->addAttributeToFilter('newproduct', 1);
$collection->setPage(1, $this->getProductsCount())->load();


texts: Upgrade magento version from 1.9.2.4 to 2.0

texts:
I want to upgrade magento version from 1.9.2.4 to 2.0.

How to achieve this ?

Anyone can explain the steps to achieve this.


texts: Empty getAddToCompareUrl only in guest mode

texts:
I have this variable $_compareUrl=$this->getAddToCompareUrl($_product) to get compare url but this is empty in guest mode, only when i signed in magento it's not empty.

I recently migrate from domain and before migrate all working fine but after migrate i have this problem. Any idea how to fix this?


texts:
I have a clothing website on Magento (www.mystore.com). Its backend path is www.mystore.com/admin.

I need to create multidomain backend i.e.

www.mystore.com/admin

www.mystore2.com/admin.

But I have to keep frontend same.


texts: How to interpret @vars and other special comment blocks in email templates?

texts:
In email template files, there are these comments which obviously have some special meaning:

How does Magento interpret these special comments?
What is this JSON-like syntax and how does it work?

{"store url=\"\"":"Store Url", "var logo_url":"Email Logo Image Url"}

How do I determine if I have to use a $ when referring to variables?

...

Deer, {{htmlescape var=$order.getCustomerName()}}


texts:
I've been fighting with this issue for days now and I can't hold it any longer.

We have Magento Community Edition 1.9 running with a extension from MageWorld Advanced Product Options.

It was an expensive extension which apparently doesn't work properly on 1.9. For days I
ve been trying to copy the product options from one product to multiple because it would save me a lot of time and the extension should automatically support it.

But it doesn't work, isn't it there any easier way to copy custom options from one product to multiple?


texts: Magento 2 | How to print all custom attributes of order?

texts:
can you tell me how I can print all custom attributes an order has programatically?

Thanks!