texts:
I must rewrite the Sitemap form in the adminhtml. I must add a new field but I can't display that. I've checked on Google and the results haven't help me.

<?xml version="1.0"?>
<config>
    <modules>
        <Dtlmmage_Sitemap>
            <version>0.7.2</version>
        </Dtlmmage_Sitemap>
    </modules>
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <sitemap_edit_form>Dtlmmage_Adminhtml_Block_Sitemap_Edit_Form</sitemap_edit_form>
                </rewrite>
            </adminhtml>
        </blocks>
        <models>
            <sitemap>
                <rewrite>
                    <sitemap>Dtlmmage_Sitemap_Model_Sitemap</sitemap>
                </rewrite>
                <resourceModel>sitemap_resource</resourceModel>
            </sitemap>
            <sitemap_resource>
                <rewrite>
                    <catalog_product>Dtlmmage_Sitemap_Model_Resource_Catalog_Product</catalog_product>
                </rewrite>
            </sitemap_resource>
        </models>
    </global>
</config>

<?php
class Dtlmmage_Adminhtml_Block_Sitemap_Edit_Form extends Mage_Adminhtml_Block_Sitemap_Edit_Form
{
    protected function _prepareForm()
    {
        $model = Mage::registry('sitemap_sitemap');
        $form = new Varien_Data_Form();

        $fieldset = $form->addFieldset('add_sitemap_form', array('legend' => Mage::helper('sitemap')->__('Sitemap')));

        $fieldset->addField('sitemap_type', 'select', array(
            'label'    => Mage::helper('sitemap')->__('Type'),
            'name'     => 'sitemap_type',
            'required' => false,
            'value'    => $model->getSitemapCategory(),
            'values'   => array(
                'categories' => 'Catégories, sous-catégories, pages filtrées, pages CMS et guides',
                'products'   => 'Produits',
                'images'     => 'Images',
            ),
        ));
        $this->setForm($form);

        return parent::_prepareForm();

       }
    }

Can you help me to solve the problem?

Thanks

Edit : I've check again on Google and I've found this solution


texts: Magento 2: Serializing a Category Tree as Primitive Types

texts:
In Magento 2, I can get a category tree with the following

    $tree     = $this->treeFactory->create();
    var_dump(
        $tree->getTree(
            $tree->getRootNode()
        )->getData()
    );

However, the data in the children_data property will be a PHP array of full PHP category objects

'children_data' =>
    array (size=8)
      0 =>
        object(Magento\Catalog\Model\Category\Interceptor)[945]
      protected '_eventPrefix' => string 'catalog_category' (length=16)

I'd like this data to be serialized is a json friendly way -- i.e., no PHP objects.

Is there an elegant way of doing this? -- I know the native Magento 2 API supports JSON output (using native category objects via service contracts), so somewhere in Magento 2 is code that will do the serialization I'm after.  I'm just not familiar enough with Magento 2's architecture to drag this up myself.


texts:
I basically want to move the tabs in the product info area. But within the details tab I want all the content of product.info. So I have tried to move the info section which has all short description add to buttons and sku to the details tab. But I am not able to move.

<move element="product.info.main" destination="product.attributes"/>

<move element="product.info.main" destination="product.info.description"/>

<move element="product.info.main" destination="product.info.details"/>

Are what I have tried. Can someone help?


texts: Discard subsequent rules not working in Cart Price Rules

texts:
I am using Magento 2.3.4. is creating rules:

Rule 1 : Buy max IDR 900,000 get a 10% discount on your cart
Rule 2 : Buy min IDR 900,000 - max IDR 3,000,000 get 20% discount on your cart

the condition is :
if the customer has ordered and gets a 20% discount, then the customer orders again with the conditions for a 10% discount, then the customer will not get another 10% discount
I've used the 'Discard subsequent rules' feature but it doesn't seem to work
The following is a display of condition settings and actions for each rule :

Rule 1

Rule 2

The first purchase gets 10% off

Second spend gets 20% off
The second purchase should not have gotten a 20% discount because the first purchase had already received a 10% discount. So customers only get 1 discount.
Is there anything wrong with my setting conditions and action rules?


texts:
I am working with a Magento 2 database that is missing the 3 wishlist tables.

wishlist
wishlist_item
wishlist_item_option

Is there a mysql script I can run to create these tables?

Thanks


texts: Incorrect behavior when sending email with use a block inside a template

texts:
When developing the module I encountered the following problem:
inside the my controller (class Index extends \Magento\Framework\App\Action\Action) there is a method that calls a method to send email send() (inside class EmailSenderResultsSync extends AbstractHelper).

E-mail is sent and works well until the template file (view/frontend/email/sync-report/index.html) contains only html code, for example:

Title

But when I try to insert a block in the template as follows:

{{block class='Magento\\Framework\\View\\Element\\Template' area='frontend' template='<vendor>_<module>::email/sync-report/test.phtml' }}

an email is sent (along with the contents of the block) only 1 time. The next time you contact the controller  (class Index extends \Magento\Framework\App\Action\Action), it does not work. The controller does not perform any actions at all.

There is no information in the logs.

I hope for help, thank you!


texts: Call store Switcher in phtml file directly in Magento 2

texts:
I want to call Store Switcher in  phtml file directly.
I tried to call directly but its not working.
Kindly review.

       $this->getLayout()
      ->createBlock('Magento\Store\Block\Switcher')
      ->setTemplate('store_switcher::switch/stores.phtml')
      ->toHtml();


texts:
I am getting very peculiar error message from Magento 1. What I'm doing is trying to "Create a shipping label", but for some reason I'm getting this error each time I check the box and press the button. I am using Avenla - SmartShip module to handle the shops shipping, but this error is stopping us from creating the shipping labels.

  Uncaught ReferenceError: packaging is not defined
        at submitShipment ((index):897)
        at HTMLButtonElement.onclick ((index):860)

What we have deducted is that it could be that some old modules have left some phtml or layout files that cause this error, but again I cant be sure, because Magento 1 has a bad habit of spreading the files all over its system and even disable or removed modules can leave their files laying around.

Avenla support said it could be override problem, but cant be sure about this. Is there anyway to quickly solve an error like this.

Any fixes or even tips leading to solve this problem are greatly appreciated.


texts: Magento-2.2 development with CSS only (no use of LESS)

texts:
I know Magento 2 uses LESS for styling but what if I'd like to build a site with CSS only?
I don't want to use LESS in my custom theme.

How can I achieve this?


texts: Magento2.3: Product quantity is not reflecting to the minicart

texts:
I have installed a module which is for adding increment and decrement buttons for quantity. After installing the module I can see the buttons in product detail page but when i update the quantity, it's not reflecting to the cart.

Below is the module I have used:

https://github.com/php-cuong/magento2-qty

Could anyone please help me with this?


texts: Refused to load the script because it violates Content Security Policy: Magento2

texts:
I am using Meetanshi Googgle Invisible Captcha Extension, Integrated with the Keys and verified they are correct.
Now when i access my form Page where the captcha suppose to be visible, it is showing the error:

I have tried with both the Captcha Version v2 and V3 Key pairs but still it is showing the error.
Also deleted all the contents, re-deploy all contents , cache removed, but i am still facing the error.
Any help regarding this?


texts: Error when editing products on Magento 2

texts:
Getting this error when trying to edit a product on my Magento 2 store.

  SQLSTATE[42S02]: Base table or view not found: 1146 Table 'webadmin_ex_lega.autosuggest_batch' doesn't exist, query was: SELECT COUNT(*) FROM autosuggest_batch AS main_table WHERE (product_id = '68') AND (store_id = '0')

Can anyone help?


texts: How canl I set condition in layout file?

texts:
I have layout file have block like this

<referenceContainer name="sidebar.additional">
   <block class="Partsoto\CategoryCustom\Block\Search" name="category.custom.replacement.search" before="-"  template="Partsoto_CategoryCustom::replacement_sidebar.phtml"/>
</referenceContainer>

I want to set condition  if querystring =  "replacement?code=AAA"

show container name = "sidebar.additional" .

Is it possible?


texts: Magento & Paypal IPN problems & failiure

texts:
We upgraded to paypal pro and then we start receiving IPN problems.
We are receiving IPN warning emails from paypal and we continue to get problems where: paypal receives the order information but nothing is confirmed back to our Magento database. The IPN history report from my paypal shows IPN retrying and failiure.
On all the retry/failiure status we have no order recorded in Magento but we do have the paypal payment.
It seems that Magento says processing payment and then returns to the shopping cart and does not show the Magento completed transaction page. Therefore the information goes out but the IPN does deliver back from paypal in our Magento.

Here is what our server side have commented;
We can see the following messages when the IPN requests are being served:

  [22/Jan/2014:09:39:10 -0600] "POST /paypal/ipn/ HTTP/1.0" 503 - "-"
  "PayPal IPN ( [link removed] )" [22/Jan/2014:09:44:31 -0600] "POST
  /paypal/ipn/ HTTP/1.0" 503 - "-" "PayPal IPN ( [link removed] )"
  [22/Jan/2014:09:55:12 -0600] "POST /paypal/ipn/ HTTP/1.0" 503 - "-"
  "PayPal IPN ( [link removed] )" [22/Jan/2014:10:16:33 -0600] "POST
  /paypal/ipn/ HTTP/1.0" 503 - "-" "PayPal IPN ( [link removed] )"
  [22/Jan/2014:09:31:16 -0600] "POST /paypal/ipn/ HTTP/1.0" 503 - "-"
  "PayPal IPN ( [link removed] )"

As per the logs of the suexec log on our servers (the service that executes your PHP scripts):

Code:

[2014-01-22 10:16:28]: info: [usr/grp]: cucumber/cucumber cmd: /home/cucumber/public_html/index.php php: /usr/local/php53/bin/php
[2014-01-22 10:16:28]: info: [usr/grp]: cucumber/cucumber cmd: /home/cucumber/public_html/index.php php: /usr/local/php53/bin/php
[2014-01-22 10:16:30]: info: [usr/grp]: cucumber/cucumber cmd: /home/cucumber/public_html/index.php php: /usr/local/php53/bin/php
[2014-01-22 10:16:33]: info: [usr/grp]: cucumber/cucumber cmd: /home/cucumber/public_html/index.php php: /usr/local/php53/bin/php

I can also see that in some cases the requests are processed properly, which is quite strange:

Code:

[22/Jan/2014:08:12:05 -0600] "POST /paypal/ipn/ HTTP/1.0" 200 - "-" "PayPal IPN ( [link removed] )"

The requests have been served properly by our server, since it executes the index.php file and it seems that the 503 error message is being returned by the Magento application itself, but not by our server.

If the message was being returned by our server, the index.php script would not be executed at all.

I am stuck with the next action in resolving this, any comments would be appreciated.


texts: Display the quantity of stock in the error message?

texts:
I want to display the quantity of stock for my product if the quantity added in the cart is higher than 'in stock'.
Where do I found the error message and edit that ?


texts: Need to regenerate downloadable_link_purchased entry for customer

texts:
We had a downloadable product that was set up incorrectly (the actual PDF we were selling wasn't linked to the product).  Somehow a customer bought the mis-configured product but now over in their "My Downloads" area they aren't showing an entry for the product.  We went back and linked up the PDF correctly, but now there doesn't seem to be an entry in downloadable_linked_purchased for this customer.

Is there a way to regenerate that link for our customer so that it will show up in their "My Downloads" area?


texts: Magento 2: How to add a new customer attribute via Setup?

texts:
I created this script to add a new customer attribute, but it's not saving on admin panel, why?

<?php

namespace Test\PhoneLogin\Setup;

use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Model\Config;
use Magento\Customer\Model\Customer;

class InstallData implements InstallDataInterface
{
    const CUSTOMER_PHONE_ATTRIBUTE =  'phone_number';

    private $eavSetupFactory;
    private $eavConfig;

    /**
     * InstallData constructor.
     * @param EavSetupFactory $eavSetupFactory
     * @param Config $eavConfig
     */
    public function __construct(EavSetupFactory $eavSetupFactory, Config $eavConfig)
    {
        $this->eavSetupFactory = $eavSetupFactory;
        $this->eavConfig       = $eavConfig;
    }

    /**
     * @param ModuleDataSetupInterface $setup
     * @param ModuleContextInterface $context
     * @throws \Exception
     * @throws \Magento\Framework\Exception\LocalizedException
     */
    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
            Customer::ENTITY,
            self::CUSTOMER_PHONE_ATTRIBUTE,
            [
                'type'                  => 'varchar',
                'label'                 => 'Phone',
                'input'                 => 'text',
                'required'              => false,
                'visible'               => true,
                'user_defined'          => true,
                'position'              => 100,
                'system'                => 0,
                'is_used_in_grid'       => true,
                'is_visible_in_grid'    => true,
                'is_filterable_in_grid' => true,
                'is_searchable_in_grid' => true
            ]
        );
        $attribute = $this->eavConfig->getAttribute(Customer::ENTITY, self::CUSTOMER_PHONE_ATTRIBUTE);
        $attribute->setData(
            'used_in_forms',
            ['adminhtml_checkout','adminhtml_customer','customer_account_edit']

        );
        $attribute->save();
    }
}


texts: How to get current_[entity] from registry?

texts:
I am creating a custom module collection which has content as product grid serialization.
I have referred article How to create the Product Grid Serializer Block In Custom module.

I use Mage::registry('current_[entity]')->getId(); to get the id. In my case I have used
Mage::registry('current_collections')->getId(); But i am getting error:

  Fatal error: Call to a member function getId() on a non-object in ..Tab/Product.php file.

How can I get current collections id from registry?


texts: Why Magento2 (and 1) use xml configuration files?

texts: Sorry for the noob question, but still I would like to clarify for yourself exactly why  Mogento2  uses XML configurations, it is because of the protocol's REST?


texts:
I get an error on Initialize method.

The provided consumer secret was rejected by the server at url 'http://localhost/oauth/initiate' for consumer key 'mycosumerkey'.

I get this error when the method is called.

Here is my call:

var client = new MagentoApi()
                    .Initialize("http://localhost",
                    "myconsumerkey",
                    "myconsumersecret")
                    .AuthenticateAdmin("adminUsername", "adminPassword");

Fiddler

Header:

OAuth oauth_callback="http%3A%2F%2Flocalhost%3A8888",oauth_consumer_key="MY_OAUTH_CONSUMER_KEY",oauth_nonce="8dplf7w2vhrynu7t",oauth_signature="flV4JMqYx0WUrl%2BoTtPYh9v3%2BQ0%3D",oauth_signature_method="HMAC-SHA1",oauth_timestamp="1466712244",oauth_version="1.0"

`
HTTP/1.1 401 Unauthorized
Date: Thu, 23 Jun 2016 20:01:06 GMT
Server: Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.5.24
X-Powered-By: PHP/5.5.24
Set-Cookie: PHPSESSID=nb4bs797b5jkcetakl0pqdhek7; path=/; domain=177.69.143.161; HttpOnly
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Length: 31
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded

oauth_problem=signature_invalid
`

My version of Magento is: 1.9.2.3

Any sugestion?


texts:
I have 1 issue confusing.
-When i am in checkout cart page. I cant click button apply coupon code.
Javascrip seems it does not work ( I try with input empty but no validate or any reaction).
But if I am in checkout onepage. I can do it.
I check template path hint and see them using 1 template default/template/checkout/cart/coupon.phtml
Someone can explain it?

Update code coupon.phtml

<form id="discount-coupon-form" action="<?php echo $this->getFormActionUrl() ?>" method="post">

            <input type="hidden" name="remove" id="remove-coupone" value="0" />

                <input class="input-text" type="text" id="coupon_code" name="coupon_code" value="<?php echo $this->escapeHtml($this->getCouponCode()) ?>" />

                    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Discount Codes')) ?>" class="button2" onclick="discountForm.submit(false)" value="<?php echo $this->__('Discount Codes') ?>"><?php echo $this->__('Discount Codes') ?></button>
                    <?php if(strlen($this->getCouponCode())): ?>
                        <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Cancel')) ?>" class="button2 cancel-coupon" onclick="discountForm.submit(true)" value="<?php echo $this->__('Cancel') ?>"><?php echo $this->__('Cancel') ?>
                        </button>
                    <?php endif;?>

</form>


texts: Magento Block disappears after override in custom module

texts:
I want to override block "upsell_products" in my custom module.
I've create a module "Parus_Upsell" with the files below. If the module is enable the block just disappears from product view page, but when is disabled the blocks shows normally. It looks like the rewrite works normally and magento can find the block (i tried to call new Parus_Upsell_Block_Upsell; and var_dump(mageFindClassFile('Parus_Upsell_Block_Upsell')); and var_dump(Mage::getConfig()->getBlockClassName('catalog/product_list_upsell')); and it all works correctly returning my class name and correct paths. Moreover, if call print_r ($this->getSortedChildren()); from the theme view.phtml it returns all children blocks except "upsell_products" (if I disable the module, the block comes back to layout).
But if I in fact haven't overridden yet anything with the block class, why it doesn't show content from default block?
Magento version is 1.9.2

/app/code/local/Parus/Upsell/Block/Upsell.php

<?php
class Parus_Upsell_Block_Upsell extends Mage_Catalog_Block_Product_List_Upsell {
}

/app/code/local/Parus/Upsell/etc/config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <Parus_Upsell>
            <version>0.1.0</version>
        </Parus_Upsell>
    </modules>
    <global>
        <blocks>
            <parus_upsell>
                <class>Parus_Upsell_Block</class>
            </parus_upsell>
            <catalog>
                <rewrite>
                    <product_list_upsell>
                        Parus_Upsell_Block_Upsell
                    </product_list_upsell>
                </rewrite>
            </catalog>
        </blocks>
        <helpers>
            <parus_upsell>
                <class>Parus_Upsell_Helper</class>
            </parus_upsell>
        </helpers>
    </global>
</config>

/app/etc/modules/Parus_Upsell.xml

<?xml version="1.0"?>
    <config>
        <modules>
            <Parus_Upsell>
                <active>active</active>
                <codePool>local</codePool>
            </Parus_Upsell>
        </modules>
    </config>


texts:
I am trying to install magento 2.1.3 but the installation stops at 53% at:

  Module 'Magento_Catalog':
  Installing data...

With the error in console:

  POST http://local.magento/setup/index.php/install/start 500 (Internal Server Error)

And my magento/var/log/debug.log file showing:

  [2017-01-07 11:07:38] main.DEBUG: cache_invalidate:  {"method":"POST","url":"http://local.magento/setup/index.php/install/start","invalidateInfo":{"tags":["EAV"],"mode":"matchingAnyTag"},"is_exception":false} []

My memory and execution time is set to:

memory_limit = 2048M
max_execution_time = 18000


texts: How do I create a configurable product with 3 options

texts:
I apologise for the vague title, I didn't know exactly what I'm asking so I'll explain and maybe someone else can come up with a better title...or the solution.

I'm trying to create a website that sells labels, each labels has three options to choose from:

How many do you want to buy (e.g. 10 pack, 50 pack, 100 pack)
What type of label it is (e.g. Removable, Permanent, Transparent)
What colour it is

There first two options combine to form a price, where as the colour option has no bearing on prices.

If for example you wanted a 10 standard labels it might be £2, where as if you wanted 10 removable labels it might be £4. The problem is that when you create a configurable product the cost for each upgrade is +something depending on the selected option, not a fixed price for a combination of options.

I also can't create a basic price with one attribute then add the rest on with another, because you have to add on different amounts depending on how many labels you buy.

Not sure if this is making any sense but hopefully somebody gets a rough idea of what I'm getting at.


texts: How to use ajax to call a function in a controller in backend custom module?

texts:
i have a controller, a index function like this.

public function indexAction()
{

    $this->loadLayout()
        ->_setActiveMenu('mycustomtab')
        ->_title($this->__('Index Action'));

    $collection = Mage::getModel('trackcode/trackcode')->getCollection();

    foreach ($collection as $code) {
        //echo $code->getOrder_id();
    }
    $this->_addContent($this->getLayout()->createBlock('trackcode/adminhtml_trackcode')->setTemplate('test/abc.phtml'));
    $this->_addContent($this->getLayout()->createBlock('trackcode/adminhtml_trackcode'));

    $this->renderLayout();
}

in a same controller:

public function ajaxAction() {
    echo 'test';

}

A abc.phtml contains a jquery function try to call above controller ajax action.

<script language="javascript">

jQuery(document).ready(function(){
    jQuery('.checkOrder').click(function(){

        jQuery.ajax({url: "adminhtml/trackcode/ajax", success: function(result){
            //$("#div1").html(result);
            alert(result);
        }});
    });
});
</script>

But the alert return a full page of backend magento html code.

Anyone know how to use ajax call a controller function?


texts: Is there any way to show the group price instead of regular price all time?

texts:
I am using Magento 1.9.3

For your convenience I am explaining with example:

Lets imagine two products.

Product1

  Regular Price : 50

  Group Price : 55

Product2

  Regular Price : 60

  Group Price : 55

When Regular Price is lower than Group Price it showing Regular Price.

Again when Regular Price is higher than Group Price it showing Group Price.

Always showing lower price.

For product1: 50 < 55 getting 50

For product2: 55 > 60 getting 55

But in both case I need to show the price: 55 (Group Price)

Can I do that?


texts: newb what is the updated URL in magento 2 for product reviews?

texts:
In earlier versions of Magento like 1.9 we were using https://domain/review-product/?rating=10 as the
product review page, but since upgrading to 2.3 this link is no longer correct. What is the proper converted review URL to handle product reviews as we did in the past?


texts:
all,
Got problem on catalog product page of Magento admin. I have a customer tab called DC, which sets design and colour for a product. A product has multiple designs and one design has multiple colours. After I clicked "save" or "save and continue edit" button at catalog product page of admin, it will pass a form of data which passes 9000 colours by attribute called product[colour][design_id]=colour_id with below architecture(I got this record from Ajax call at chrome's network):

form_key:R9ciMhP8JKHhEF32
product[status]:2
product[description]:
assigned[designs]:xxxxxxx
product[colour][1][]:1
...
product[colour][9000][]:9000
page:1
limit:20
form_key:R9ciMhP8JKHhEF32

We got all attributes.However, we didn't get all records of product[colour][design_id]. It only got 830 colours at the back end. I also debugged at Zend's HTTPS getPost function, I still only got 830 colour. Here is the backend data I got:

array(
product[status]:2
product[description]:
assigned[designs]:xxxxxxx
product[colour][1][]:1
...
product[colour][830][]:830
page:1
limit:20
)

Anyone have idea that why that happened?
Thank you very much.


texts:
I have a custom admin module where I want to programatically create and share a wishlist.

I managed to create it programatically and to send the email (it arrives ok), but the "$wishlistBlock" and therefore, the email is empty.

I'm not such advanced in Magento yet, do I have to rewrite the model/modelresource/block or something like to get it working in my custom module? Tried a lot of different things, none worked.

This is the offending piece of code:

                    $wishlist = Mage::getModel('wishlist/wishlist')->loadByCustomer($customerId, true);

                    foreach($products as $product) {
                        $product = Mage::getModel('catalog/product')->load($product->getId());
                        $buyRequest = new Varien_Object(array()); // any possible options that are configurable and you want to save with the product
                        $result = $wishlist->addNewItem($product, $buyRequest);
                    }

                    Mage::helper('wishlist')->calculate();

                    $message = "";
                    $emailModel = Mage::getModel('core/email_template');
                    $sharingCode = $wishlist->getSharingCode();
                    //this var returning empty
                    $wishlistBlock = Mage::getSingleton('core/layout')->createBlock('wishlist/share_email_items')->toHtml();

                    $emailModel->sendTransactional(
                        Mage::getStoreConfig('wishlist/email/email_template'),
                        Mage::getStoreConfig('wishlist/email/email_identity'),
                        $email,
                        null,
                        array(
                            'customer'       => $customer,
                            'salable'        => $wishlist->isSalable() ? 'yes' : '',
                            'items'          => $wishlistBlock,
                            'addAllLink'     => Mage::getUrl('*/shared/allcart', array('code' => $sharingCode)),
                            'viewOnSiteLink' => Mage::getUrl('*/shared/index', array('code' => $sharingCode)),
                            'message'        => $message
                        )
                    );

                    $wishlist->setShared(1);
                    $wishlist->save();

                    Mage::dispatchEvent('wishlist_share', array('wishlist' => $wishlist));
                    Mage::getSingleton('adminhtml/session')->addSuccess(
                        $this->__('Your Wishlist has been shared.')
                    );

Thanks in advance.


texts: Fix Category Url Filter in Magento 2 Layered Navigation

texts:
By default in Magento 2, the category links look like this

They lead to ?catId=xxx, instead of the better SEO friendly links, like the product name.

I found a solution for this issue, but it's for magento 1, and it look like this:
I found this here solution link

the orignal code:

public function getUrl()
{
    $query = array(
        $this->getFilter()->getRequestVar()=>$this->getValue(),
        Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
    );
    return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
}

and then the custom code to solve the issue:

public function getUrl()
{
    if($this->getFilter()->getRequestVar() == "cat"){
        $category_url = Mage::getModel('catalog/category')->load($this->getValue())->getUrl();
        $return = $category_url;
        $request = Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true));
        if(strpos($request,'?') !== false ){
            $query_string = substr($request,strpos($request,'?'));
        }
        else{
            $query_string = '';
        }
        if(!empty($query_string)){
            $return .= $query_string;
        }
        return $return;
    }
    else{
        $query = array(
            $this->getFilter()->getRequestVar()=>$this->getValue(),
            Mage::getBlockSingleton('page/html_pager')->getPageVarName() => null // exclude current page from urls
        );

        return Mage::getUrl('*/*/*', array('_current'=>true, '_use_rewrite'=>true, '_query'=>$query));
    }
}

For magento 2, we have the same function in
vendor\magento\module-catalog\Model\Layer\Filter\Item.php we have  getUrl() function

Dose anyone know what it's the equivalent code for magento 2?


texts:
I have created a custom product level attribute in magento now I want that attribute in my cart so I created the column in quote item table now I need the value of that attribute, while adding products into cart. I am facing issue when I add configurable product in cart.

This is my code

public function salesQuoteItemSetCustomAttribute($observer)
{
    $quoteItem = $observer->getQuoteItem();
    $product = $observer->getProduct();
    $quoteItem->setCustomAttribute($product->getCustomAttribute());
}

It returns me configurable attribute value not the child products or simple products attribute value


texts: Magento2 Copy Customer name to invoice billing address name

texts:
For billing issues i want to use default customer name as same
billing address in invoice only.
i.e Customer name is John Doe and he use Johny Doe in billing
address when he order. it is ok for order but when invoice will create it should
update to John Doe in billing address in invoice only.
He may pay by online of offline whatever.

How can i achieve it?


texts: Magento 2 Admin Page Error: Your current session has been expired

texts:
Fresh Install of Magento 2.2.2 on Centos (Plesk) with Apache 2.4, php 7.0.2 + all modules, mariaDb 10.1.

Magento Installation was done via browser wizard -> readyness check-> everything was ok. When I try to login to the Magento Admin Page "Your current session has been expired." is always showing.

I am running Magento 2.1.7 on this Server and had the same problem. But I solved this problem by changing one line of Timezone.php (shown in here  https://github.com/magento/magento2/issues/5383). However with Magento 2.2.2 this solution does not work anymore.

Any Ideas how to solve this ?

Ps: Already cleared cache folders and cache via cli.

When I run "php -v" via SSH --> php 7.0.27 is shown

I configured Php 7 (via Plesk) for scripts on my domain
"/opt/plesk/php/7.0/bin/php -v" --> shows php 7

BUT phpMyAdmin (login to mariaDB) shows this (php 5.6.30):

Maybe this is causing the error ?


texts: Magento 2 translate error showing curly braces

texts:
Just update Magento to 2.3.0 and get these messages.
I tried to remove translation files and do static-content:deploy.
Did not help.


texts:
I tried to create custom cron job and it's all works, but how can I turn it off so it will not run again.

I already tried to comment (//) the cron job in crontab.xml but it's not working.


texts: Unable to set the order status after sales_order_save_after

texts:
I want to check my order and if my order has any back order items i want to set the order status as Back orders(My custom status code is backorders).

My config.xml <events> section is : -

<events>
    <sales_order_save_after>
        <observers>
            <stainless_backorders>
                <class>stainless_backorders/observer</class>
                <method>updateOrderStatus</method>
            </stainless_backorders>
        </observers>
    </sales_order_save_after>
</events>

My Observer.php file contains below codes :-

public function updateOrderStatus($observer) {

    $orderId = $observer->getOrder()->getIncrementId();
    $order      = Mage::getModel('sales/order')->loadByIncrementId($orderId);
    $ordered_items = $order->getAllItems();
    $backorder_status = '';

     foreach ($ordered_items as $item) {
         $item->getProduct()->getProductId();
         $itemQtyBackordered = intval($item->getQtyBackordered());
         $orderedQty = $item->getQtyOrdered();
         $totalQty = (int)$item->getProduct()->getStockItem()->getQty();

        if($itemQtyBackordered>0){
            $backorder_status = 1;
        }
     }
     if($backorder_status==1){
        $order->setStatus("backorders");
        $order->save();
     }
}

If i use $order->setStatus("backorders"); this line to change the status i am getting an error like below and if i use this line the observer function is calling several times, why is this?

If i comment this line only one time its reachinf this method.

My question is , Is my approach is right? In wich stage an orders status is saved in the magento database?
If not how can i do this task?

UPDATE : My config.xml

<sales>
      <order>
        <statuses>
          <backorders translate="label">
            Back Orders
          </backorders>
        </statuses>
        <states>
          <backorders translate="label">
            Back Orders
            <statuses>
              <backorders default="1"/>
            </statuses>
          </backorders>
        </states>
      </order>
</sales>


texts: How to customize subtotal in shopping cart

texts:
I re-wrote updatePostAction() in a new class extended from Mage_Checkout_CartController. It has a special formula to calculate its subtotal. In debug mode, it calculates correctly, but the correct subtotals are not persistent. For example,

Line 88: $item->setRowTotalInclTax( $totalAmountInclTax );

In debug mode:
Before executing Line 88, $item->getRowTotalInclTax() returns 85.09. After executing, $item->getRowTotalInclTax() returns 92.61. This is correct in debug mode according to requirements.

But, shopping cart page displays old value 85.09 instead of 92.61. Should I save this new calculated value again somehow?

Edit:
Later, I wrote an extension to override Mage_Sales_Model_Quote_Address_Total_Subtotal as follows:

<config>
    <global>
        <models>
            <sales>
                <rewrite>
                    <quote_address_total_subtotal>MyExt_Sales_Model_Quote_Address_Total_Subtotal</quote_address_total_subtotal>
                </rewrite>
            </sales>
        </models>
    </global>
</config>

Model:

class MyExt_Sales_Model_Quote_Address_Total_Subtotal extends Mage_Sales_Model_Quote_Address_Total_Abstract
{
    public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        ...

        //test
        $baseVirtualAmount = 333;
        $virtualAmount = 333;

        $address->setBaseVirtualAmount($baseVirtualAmount);
        $address->setVirtualAmount($virtualAmount);

        .....

        return $this;
    }

But, the cart Update event doesn't call this collect() method.


texts: Magento 2 - Remove option for same biling and shipping

texts:
I have a site which requires all customers to enter a different shipping and billing address. I know a little strange but all orders will have a different shipping and billing.

The problem I have is that I have lazy customers who just tick the box, but I need both shipping and billing to be filled in.

Is there a way to remove the checkbox and have the billing address form visible? I have tried writing a module but couldn't get it to work. Is there an easy solution to this?

Thanks


texts: Magento 2.3: Show content block in terms & agreement popup at checkout

texts:
I want to show one or more content blocks in the terms and conditions popup at the checkout page.

All of the business terms, revocation terms, data privacy terms are stored in content blocks and so this is one location which has to be up to date if there are changes.
Copy & Paste all the different things is not safe if you want to be sure to have always the same law terms everywhere in your store views.

I want to put one or more

{{block class="Magento\Cms\Block\Block" block_id="your_block_identifier"}}

into the content field in

  Stores > Terms and Conditions

and maybe some HTML text and all of this should appear in this popup Box.

Is there a way to achieve this? Thanks!


texts: Fatal error: Class 'Zend\Stdlib\Glob' after install - Magento 2

texts:
After install I got this error:

Fatal error: Class 'Zend\Stdlib\Glob' not found in C:\xampp\htdocs\Proj\zobita\vendor\magento\framework\Filesystem\Glob.php on line 14

What is the problem and how to fix it?


texts:
We are getting ready to upgrade from v2.2.2 to v2.2.4. Due to our deployment process, I need to push the composer.json so it can be upgraded properly via the git rather than doing it in the backend.

But I just noticed that a second version number shows up in the top of the composer.json file. It currently shows our original version (2.2.1). Should this one be left alone to show the 'original' or should it be updated also?

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "version": "2.2.1",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "require": {
        "magento/product-community-edition": "2.2.2",
        "composer/composer": "@alpha",

[.....]


texts:
Can anyone pls let me how to make a quick look popup for Categories just like we do for products ?

I want to display all the sub-categories listing in a popup when clicked on any parent category having child categories

Is it possible ?

Any custom code / extensions are welcome


texts: How to list all currently online admin users?

texts:
In Magento I have created multiple admins with different roles. How do I get the list of online admin users. Similar to the online customers list?

I have used

Mage::getSingleton('admin/session')

but this is providing only the current user's details.

Is there any build in functions. If not, how to create similar thing?


texts: Magento2 custom UTF icons corrupted in frontend

texts:
I've got a problem with certain icons not being displayed correctly in a store I'm working on.

The relevant css, as far as I can tell:
/*
* Font Icon
*/

@mixin font-icon($icon:'\e5cd', $font-family:$default-icon-family) {
    line-height: inherit;
    &:before {
        content: $icon;
        display: inline-block;
        font-family: $font-family;
        font-weight: 400;
        text-rendering: auto;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
        transform: translate(0, 0);
    }
}

@mixin font-icon__pseudo($icon:'\e5c7', $font-family:$default-icon-family) {
    content: $icon;
    display: inline-block;
    font-family: $font-family;
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    transform: translate(0, 0);
}

I'm unfamiliar with how Magento processes this kind of thing, but it seems to be working for other icons like the heart in the screenshot, but not for the icon on the right. Any thoughts much appreciated.


texts:
We are using Magento CE 1.7.0.2, Incorrect order total showing in sales order due to price round issue.

Subtotal                             $15.98
Shipping & Handling                  $6.95
Discount (10% off any size order)   -$1.60
Tax                                  $1.81
Grand Total                          $23.15
Total Paid                           $0.00
Total Refunded                       $0.00
Total Due                            $23.15

As per above totals, if we calculate mathematically, grand total value should be $23.14 but it is showing $23.15, when we print total without using formatPrice() function, it is showing 23.1452.

Can anyone help me to resolve such issue.
Thanks in advance


texts: How to include a template for a static xml block

texts:
Can I include a template into the xml for designing a specific static block? This would enable a non technical user to create a static block in the admin, without having to add a   into the html part of the admin/cms editor? So in the template there would just be the html markup for the  part ? Is that possible?

<?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">

<referenceContainer name="content">
        <block name="cms.block1" before="-" class="Magento\Cms\Block\Block" cacheable="true">
            <arguments>
                <argument name="block_id" xsi:type="string">cms_block_1</argument>
            </arguments>
        </block>

      <block name="cms.block2" after="cms.block1" class="Magento\Cms\Block\Block" cacheable="true">
            <arguments>
                <argument name="block_id" xsi:type="string">cms_block_2</argument>
            </arguments>
        </block>
    </referenceContainer>

</page>

This is my xml which handles the static blocks on the homepage. Now I added the  manually into the static blocks.

So how to call a .phtml file? And how would that file look like?

Can I just have:

 in that file or
do i need something like:
cms_block_1
 ?


texts: Multiple block form in same back end magento 1.9

texts:
I'm new to Magento. I've built some grid and Edit forms, but I don't know how to add multible edit block and tables in the same page.

What I've built is something like this:

What I need is something like this:

This is my edit Form.php

class Ns_Thorleif_Block_Adminhtml_Commerciaux_Edit_Tab_Form extends Mage_Adminhtml_Block_Widget_Form
{
    protected function _prepareForm()
    {
        $form = new Varien_Data_Form();
        $this->setForm($form);

        $fieldset = $form->addFieldset('commerciaux_form', array('legend' => 'Informations'));

        $fieldset->addField('name', 'text', array(
            'label' => 'Name',
            'class' => 'required-entry',
            'required' => true,
            'name' => 'name'
        ));

        $fieldset->addField('city', 'text', array(
            'label' => 'City',
            'class' => 'required-entry',
            'required' => true,
            'name' => 'city'
        ));

        if ($commerciauxData = Mage::registry('commerciaux_data')) {
            $form->setValues($commerciauxData->getData());
        }
        return parent::_prepareForm();
    }
}


texts: Magento 2 move page main title into div with product_list_toolbar

texts:
I want to move the page main title on the category list page into custom div and also include the product_list_toolbar into that div.

The problem I face is that I can not simply move the product_list_toolbar, because that is not allowed in M2.

Is there a way to create a div inside the /app/design/frontend/theme/theme/Magento_Catalog/templates/product/list.phtml and move the page.main.title into that div?

So something like this in the category list template:

<div class="category-page-header" id="category.page.header">
    <?= $block->getToolbarHtml() ?>
</div>

And then inside the catalog_catagory_view.xml file:

<move element="page.main.title" destination="category.page.header" before="-"/>

Any ideas how to create this div around both elements?

I can solve it by adding the following into the /app/design/frontend/theme/theme/Magento_Catalog/templates/product/list.phtml file.

<?php $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$category = $objectManager->get('Magento\Framework\Registry')->registry('current_category');?>

<?= $category->getName() ?>

Will this be the best and only solution?


texts: Magento 2 - How to add Extra Checkout Step after Review & Payments Section with Place Order Button

texts:
I am trying to add an additional checkout step after "review & payments" section. The requirement is to split the payment and review as a separate steps. Once the after the payment method is selected, it should navigate to the Final step "review" where all the order information has to be shown with "place order" button.

so far i have added custom step after payment step, by following the link below.
http://devdocs.magento.com/guides/v2.0/howdoi/checkout/checkout_new_step.html

But the Problem here is the "Place Order" Button is binded with the Payment Step, I need to move the place order button to the Last Step.

Any Help Most Appreciated!!


texts: Magento2: Filter ProductCollection by Product Type (type_id)

texts:
I have the following in my custom module helper:

public function __construct(
  \Magento\Framework\App\Helper\Context $context,
  \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection,
  array $data = []
) {
  $this->_productCollection = $productCollection;
  parent::__construct($context);
}

and use the following method:

/**
 * Get the product collection filtered by field
 *
 * @param $field
 * @param $value
 * @return $this
 */
public function getProductCollection($field, $value)
{
    $collection = $this->_productCollection->load();
    $collection->addFilter($field, $value);
    return $collection;
}

In my controller I call the method as such to get all products of type 'simple':

$products = $this->dataHelper->getProductCollection('type_id', 'simple');

However, this doesn't work as it gives me all products, no matter what type.

I can get the type when I use:

$products->getTypeId();

How do I correctly filter my collection my type_id?


texts: My code/local/ is being overidden, how do I find out where!

texts:
Hi I basically have a code/local/ of a core file I edited.

/app/code/local/Mage/Adminhtml/block/sales/order/Grid.php

This was to add a "Company" column to the order grid.

Since updating to 1.9.2.2 and updating a few plugins around the site this has stopped working.

I am guessing another plugin is over riding my function or extending the class elsewhere?

I have had a look in the folders in my code/local/ but can't seem to find anything.

Is there a debug tool I can use in the backend of magento or a way of finding out what it going over my codes head?


texts: Programmatically creating an order: How to add custom options to products in quote?

texts:
I'm trying to create an order programmatically. With simple products without custom options it already works like a charm. But when I try to add custom options I get the very specific error:

  We found an invalid request for adding product to quote.

Here is my foreach adding the products to quote

foreach($orderData['items'] as $item){
     $product=$this->_product->load($item['product_id']);
     $product->setPrice($item['price']);
     $params = array();
     $options = array();
     $params['qty'] = intval($item['qty']);
     $params['product'] = $item['product_id'];
     $params['form_key'] = $this->formKey->getFormKey();
     if(array_key_exists("options", $item)){
          foreach($item["options"] as $value){
                $options[$value['option_id']] = ($value['option_type_id']);
          }
          $params['options'] = $options;
     }
     $this->_logger->info("params: " . print_r($params, true));
     $quote->addProduct($product, $params);
}

The Log entry for $params shows this (which looks correct to me according to every tutorial I could find on this):

[2019-01-21 14:56:08] main.INFO: params: Array
(
    [qty] => 1
    [product] => 3392
    [form_key] => LQbWtaWdFhvMDD3h
    [options] => Array
        (
            [110465] => 239176
            [110466] => 239179
            [110467] => 239185
            [110468] => 239190
            [110469] => 239192
            [110470] => 239196
        )

)

[options]['key'] is the option's Id, [options]['key'] => $value is the option's value's Id (which is correct, triple checked it).

Does anybody have an idea where my mistake is? Or for that matter, how to debug it further? Because trying to catch the exception results in the same Error Message which, like I already said, is not very specific.


texts:
This is Observer.

    <?php
namespace SimpleMagento\Custom\Observer;

//use Magento\Framework\Event\Observer;
use Magento\Framework\Event\ObserverInterface;

class Another implements ObserverInterface
{
    protected $redirect;
    protected $url;
    protected $responseFactory;
    public function __construct(
        \Magento\Framework\UrlInterface $url,
        \Magento\Framework\App\Response\Http $redirect,
        \Magento\Framework\App\ResponseFactory $responseFactory
    )
    {
        $this->url = $url;
        $this->redirect = $redirect;
        $this->_responseFactory = $responseFactory;
    }

    public function execute(\Magento\Framework\Event\Observer $observer)
    {
        $customurl = $this->url->getUrl('hello/Test/Customer');
        $this->_responseFactory->create()->serRedirect($customurl)->sendResponse();
        die();
    }
}

?>

The event is

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="customer_register_success">
        <observer name="new-data-add" instance="SimpleMagento\Custom\Observer\Another" />
    </event>
    </config>

Provided controller url is working fine (cheched in browser) but not with observer hello/Test/Customer .
Same page is redirecting as soon as you successfully register.(data not going to database and not even observer working)


texts:
In Magento 2.3.5 product page when click review text or reviews and not going to review form or Customer review sometime it's working and sometimes in console I get this error,
Uncaught Error: no such method 'activate' for tabs widget instance


texts: 1.9.0.1 dataflow import customers. Different results when ran from browser or shell

texts:
I'm magrating to Magento, and I have a large amount of customers to import. I am using the dataflow profiles because more fields are available. The problem of importing dozens of thousands of customers by running the profile in a popup is that it will time out and fail.

I am then using a script to run a profile from the command line. It works fine and is MUCH faster than using the browser, however, I am facing a strange problem. Running the profile from the browser reads the "is_subscribed" fields and subscribes the customer to the newsletter is the value equals 1, but it won't subscribe the customer if I run the profile from the command line.
Everything else imports fine from the command line. All the data is there, except the newsletter subscription which seems to be ignored.

I tried to change the file format of the import from CSV to XML, ran the script using root access, ... nothing, it will never subscribe the customer to the newsletter if running the script from the command line.

Here is a sample of the csv file with one customer that imports fine from a browser but not from the command line :
website,email,group_id,firstname,lastname,billing_street1,billing_street2,billing_city,billing_region,billing_country,billing_postcode,billing_telephone,created_in,is_subscribed,group
base,johndoe@gmail.com,group01,John,Doe,555 west street,,Los Angeles,CA,US,90001,5551237894,en,1,group01

Any input on what to do/look for ?

Thanks

Code:

<?php
/* ONLY WORK VIA CRON OR SSH: /usr/bin/php -f /var/www/magento/cron_import.php */
/* http://www.magentocommerce.com/boards/viewthread/35865/ */
if ($_SERVER["SERVER_ADDR"] == $_SERVER["REMOTE_ADDR"]) {

  $profileId = 7;
  $logFileName= 'import-profile-7.log';
  $recordCount = 0;

  require_once 'app/Mage.php';

  Mage::app();

  Mage::log("Starting",null,$logFileName);

  $profile = Mage::getModel('dataflow/profile');
  $userModel = Mage::getModel('admin/user');
  $userModel->setUserId(0);
  Mage::getSingleton('admin/session')->setUser($userModel);

  if ($profileId) {
    $profile->load($profileId);
    if (!$profile->getId()) {
      Mage::getSingleton('adminhtml/session')->addError('ERROR: Incorrect Profile');
    }
  }

  Mage::register('current_convert_profile', $profile);

  $profile->run();

  $batchModel = Mage::getSingleton('dataflow/batch');
  if ($batchModel->getId()) {
    if ($batchModel->getAdapter()) {
      $batchId = $batchModel->getId();
      $batchImportModel = $batchModel->getBatchImportModel();
      $importIds = $batchImportModel->getIdCollection();
      $batchModel = Mage::getModel('dataflow/batch')->load($batchId);
      $adapter = Mage::getModel($batchModel->getAdapter());
      foreach ($importIds as $importId) {
        $recordCount++;
        try{
          $batchImportModel->load($importId);
          if (!$batchImportModel->getId()) {
             $errors[] = Mage::helper('dataflow')->__('WARNING: Skip undefined row');
             continue;
          }
          $importData = $batchImportModel->getBatchData();
          try {
            $adapter->saveRow($importData);
          } catch (Exception $e) {
            Mage::log($e->getMessage(),null,$logFileName);
            continue;
          }
          if ($recordCount % 50 == 0) {
            Mage::log($recordCount . ' completados',null,$logFileName);
          }
        } catch(Exception $ex) {
          Mage::log('Fila ' . $recordCount . ', SKU ' . $importData['sku']. ' - ERROR: ' . $ex->getMessage(),null,$logFileName);
        }
      }
      foreach ($profile->getExceptions() as $e) {
        Mage::log($e->getMessage(),null,$logFileName);
      }
    }
  }
  printf("OK\n");
  Mage::log("Completed",null,$logFileName);
}
?>


texts: magento 2.2.5 attribute label showed on products page

texts:
I am using Porto on Magento 2.2.5,
in the products page there is a text box under the attribute labels, how can I remove it or hide it.
link to product page:
link to product page

screenshot:

tnx,


texts: Magento2 500 error when viewing products in admin - after Migration

texts:
I've just migrated to a MAgento 2.2.5 website.

It was generally successful except for one issue.

When trying to click into a specific product in the admin area I get a 500 error.

The server reports this as follows...

 client denied by server configuration: app/etc/config.php

From my understanding this is a permissions issues, right? The etc folder has 755 set. It is strange that is affects products only.

I've cleared cache and index.

Any help would be appreciated.


texts: Magento2 CE Latest Release Object DOMDocument should be created

texts: After I installed final Magento2 CE I got error as Object DOMDocument should be created . Anyone knows why? This is working fine in previous release version and there is sudden change when i transfer my module here.


texts:
This might be more of a conceptual question, but I'm trying to think of the best solution to associate an image with each attribute option.

Specifically: our products have a "manufacturers" attribute. I'd like to set up a way to add/remove images for each manufacturer option, so that I can display that manufacturer logo on the product page / pull it in as needed throughout the site.

Any thoughts? Thanks!


texts: Override magento 2 email/items/order/default.phtml

texts:
I am trying to override vendor/magento/module-sales/view/frontend/templates/email/items/order/default.phtml in my module.

I have tried below mentioned mentioned method but its not working.

I have copied vendor/magento/module-sales/view/frontend/layout/sales_email_order_renderers.xml in my module app/code/Company/Module/view/frontend/layout/sales_email_order_renderers.xml and updated code with below mentioned code :

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Email Creditmemo Items List" design_abstraction="custom">
    <body>
        <referenceBlock name="sales.email.order.renderers">
            <action method="setTemplate">
                <argument name="template" xsi:type="string">Company_Module::email/items/order/default.phtml</argument>
            </action>
        </referenceBlock>
    </body>
</page>

and copied default.phtml file in my module folder app/code/Company/Module/view/frontend/templates/email/items/order/default.phtml and added few texts but those texts are not appearing. Please help.


texts: Overridden Cart block does not load template

texts:
I'm trying to customize a Magento 2.1 cart page both by overriding the Block Cart and accessing some of the overridden elements in a new phtml template.

I hit a roadblock after overriding the Cart block however, as it appears the overridden block in never loading any cart form.phtml, custom or otherwise.

I have created the override by creating the app/code/Vendor/Module/Block/Cart.php file that extends \Magento\Checkout\Block\Cart

<?php
namespace Vendor\Module\Block;

use Magento\Framework\View\Element\Template;

class Cart extends \Magento\Checkout\Block\Cart {
    public function getContinueShoppingUrl() {
        return 'http://externalurl/from/config';
    }
}

I have also created app/code/Vendor/Module/etc/di.xml with the configuration

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  <preference for="Magento\Checkout\Block\Cart" type="Vendor\Module\Block\Cart" />
</config>

I know that the overridden block is at least loading, as I can get output from echoing items in the constructor and there appear to be no other errors in the log.  However, when I go to the /checkout/cart/ page, where I expect the checkout details to load I get nothing - just the typical header and footer elements surrounding a blank page.

Any idea what I'm missing here?


texts: Magento 2 - change value in admin order grid column

texts:
I want to change value in admin order grid table in "Grand Total (Base)" column. Just add some value to it. I assume I need to create sales_order_grid.xml in my module and create block with prepareDataSource() function like when I adding new column to grid. But how to override the existing one?

So in original xml we have:

<column name="base_grand_total" class="Magento\Sales\Ui\Component\Listing\Column\Price">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="filter" xsi:type="string">textRange</item>
            <item name="label" xsi:type="string" translate="true">Grand Total (Base)</item>
        </item>
    </argument>
</column>

Basically all I need is set my one class instead of Magento\Sales\Ui\Component\Listing\Column\Price. Any idea how to do that?


texts: How to insert the script, just after the start of the head tag using layout file in magento

texts:
I used this, but it doesn't show my script, just after the head tag start

<reference name="head">
  <block type="core/text" name="header_module" as="header_module">
    <action method="setText">
        <text><![CDATA[<script>My_Script</script></text>
    </action>
  </block>
</reference>

example:

<head>
<script> my_script</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>home</title>
....
.....
..
</head>

i want to show just after the head tag, not between the other script

Any other methods?
Thanks


texts: my js has some problems, it is jumping from $.widget to return $.devall.popupmanager and fail function is getting called at the end

texts:
define([
    'jquery',
    'Magento_Ui/js/modal/modal',
    'mage/cookies'
], function ($, modal) {
    'use strict';

    if(!$.cookie('popup_cookie') ) {

        $.widget('devall.popupManager', {

             /**
             *
             * @private
             */

            _create: function () {
                var self = this,
                    popup_newsletter_options = {
                        type: 'popup',
                        responsive: true,
                        innerScroll: true,
                        title: this.options.popupTitle,
                        buttons: false,
                        modalClass: 'popup-devnewsletter'
                    };
                var expDate = new Date();

                expDate.setTime(expDate.getTime() + (3650000 * 60 * 1000));
                $.cookie('popup_cookie', 1, {expires: expDate});

                modal(popup_newsletter_options, this.element);
                setTimeout(function () {
                    self._setStyleCss();
                    self.element.modal('openModal');
                }, 3000);
                this.element.find('form').submit(function () {
                    if ($(this).validation('isValid')) {
                        console.log("Hello 1!");
                        $.ajax({
                            url: $(this).attr('action'),
                            cache: true,
                            data: $(this).serialize(),
                            dataType: 'json',
                            type: 'POST',
                            showLoader: true,
                        }).done(function (data) {
                            console.log("Hello 2!");

                            self.element.find('.popup-manager .messages').html(data.message);
                            if (data.error) {
                                self.element.find('.messages .message').addClass('message-error error');
                                self.element.modal('closeModal');
                                self.element.find('.messages .message').addClass('message-success success');
                                // var cookieExpires = new Date(new Date().getTime() + this.options.cookieLifetime * 1000);

                                setTimeout(function () {
                                    self.element.modal('closeModal');
                                }, 1000);
                            }
                            self.element.find('.messages').show();

                            setTimeout(function () {
                                self.element.find('.messages').hide();
                            }, 5000);
                        }).fail(function (data) {
                            alert("Error");
                        })

                    }
                    return false;
                });

                this._resetStyleCss();
            },

            /**
             * Set width of the popup
             * @private
             */
            _setStyleCss: function (width) {

                width = width || 400;

                if (window.innerWidth > 786) {
                    this.element.parent().parent('.modal-inner-wrap').css({'max-width': width + 'px'});
                }
            },

            /**
             * Reset width of the popup
             * @private
             */
            _resetStyleCss: function () {
                var self = this;
                $(window).resize(function () {
                    if (window.innerWidth <= 786) {
                        self.element.parent().parent('.modal-inner-wrap').css({'max-width': 'initial'});
                    } else {
                        self._setStyleCss(self.options.innerWidth);
                    }
                });
            },

        });

        return $.devall.popupManager;
    }

    return 0;

});


texts: Magento 2: After using composer to install, can the "update" folder be deleted?

texts:
After installing Magento 2 using the composer method, the update folder that is used to create the project with remains. I cannot see any reason to keep it after installing the composer dependencies.

Is it safe to delete?


texts: Zend_Json_Exception Decoding failed: Syntax error some time in Magento (All versions)

texts:
1 exception(s):
  Exception #0 (Zend_Json_Exception): Decoding failed: Syntax error
  Exception #0 (Zend_Json_Exception): Decoding failed: Syntax error#0 /var/www/html/magento2/vendor/magento/framework/Json/Decoder.php(20): Zend_Json::decode('') #1 var/www/html/magento2/vendor/magento/framework/Json/Helper/Data.php(58): Magento\Framework\Json\Decoder->decode(false)

In my custom mdoule I am creating a slider by fetching data form API.

  IN /var/www/html/magento2/app/code/Custommodule/ReviewRating/Block/HomehorizontalWidget.php

<?php
namespace Custommodule\ReviewRating\Block;

class HomehorizontalWidget extends \Magento\Framework\View\Element\Template
{
protected $_helper;
protected $jsonHelper;

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    array $data = [],
    \Custommodule\ReviewRating\Helper\Data $helper,
    \Magento\Framework\Json\Helper\Data $jsonHelper
) {
    parent::__construct($context, $data);

    $this->_helper = $helper;
    $this->jsonHelper = $jsonHelper;
}

  .................

 public function get_reviews_data( $url ){
        $dataResponse = $this->getDataFromApi($url);
        return $dataResponse['data']['reviews'];
 }

    public function getDataFromApi($url)
    {

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
        curl_setopt($ch, CURLOPT_TIMEOUT, 5);
        $data = curl_exec($ch);
        $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        $decodedData = $this->jsonHelper->jsonDecode($data);

        return ($httpcode>=200 && $httpcode<300) ? $decodedData : false;

    }

  IN /var/www/html/magento2/app/code/Custommodule/ReviewRating/view/frontend/templates/homehorizontalwidget.phtml

    $url = "http://website.com/api?url";

       $reviewsData = $this->get_reviews_data( $url );
       echo "<pre>";
       print_r( $reviewsData );
       echo "</pre>";
?>

Update : I chnaged few things as below ( No idea is it the perfect way or not)

Below code is from Magento 1.X version

  1) Return 0 if empty

public function getDataFromApi($url)
    {

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
        curl_setopt($ch, CURLOPT_TIMEOUT, 5);
        $data = curl_exec($ch);
        $data = ( string ) $data;
        $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        if( empty( $data )){ // retrun 0 if empty
            return 0;
        } else {
            return ($httpcode>=200 && $httpcode<300) ? $data : false;
        }

}

  2)  check on phtml page is array is empty or not

   $reviewsData = $this->get_reviews_data( $url );
      $reviewsImages = $this->get_reviews_images( $url );
      $totalRatingCount = $this->get_avg_reviews_count( $url );
      $avgRating = $this->get_avg_reviews_rating( $url );

if( empty( $totalRatingCount) && empty( $avgRating ) && empty( $reviewsData ) && empty( $reviewsImages) ){
        return;
      }


texts: How to sort the order of Magento joinLeft

texts:
I am trying to use a join query in Magento Abandoned Grid this way:

 $collection->getSelect()->joinLeft(
                        'abandoned_comment_history', 'main_table.customer_id=abandoned_comment_history.customer_id', array('admin_comment', 'comment_datetime', 'status'))
                ->group('main_table.customer_id');

In my custom table abandoned_comment_history there are multiple matches with main table.customer_id & i am getting the first one but i need last one.

Is there any way to get the last match from my custom table.
I searched a lot but couldn't find the solution. Hope will get here.

Description: In my table abandoned_comment_history have some data as

id customer_id admin_comment
1     2082      Test 1
2     2082      Test 2
3     2091      Hello

In main_table customer_id column is unique.

  customer_id
     2082
     2084
     2091

Now if i try to join & get admin_comment value i get "Test 1" but i need "Test 2"


texts: Could not create an acl object: Invalid Document in magento2.3.0

texts:
In magento 2.3.0 for new module is throws an exception like below image url
http://prntscr.com/n7rpgb

my acl.xml file like this

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Acl/etc/acl.xsd">
    <acl>
        <resources>
            <resource id="Magento_Adminhtml::admin">
                <resource id="Ram_Seller::seller" title="Seller" sortOrder="100"/>
 <!--AddMenuAcl-->
            </resource>
        </resources>
    </acl>
</config>


texts:
I'm getting below kind of Exception

exception 'RuntimeException' with message 'The path "D:/wamp/www/magento2/var/generation/Magento/Swatches/Block/Adminhtml/Product/Attribute/Edit/FormFactory.php.10248" cannot be renamed into "D:/wamp/www/magento2/var/generation/Magento/Swatches/Block/Adminhtml/Product/Attribute/Edit/FormFactory.php" Warning!rename(D:/wamp/www/magento2/var/generation/Magento/Swatches/Block/Adminhtml/Product/Attribute/Edit/FormFactory.php.10248,D:/wamp/www/magento2/var/generation/Magento/Swatches/Block/Adminhtml/Product/Attribute/Edit/FormFactory.php): The process cannot access the file because it is being used by another process. (code: 32)' in D:\wamp\www\magento2\vendor\magento\framework\Code\Generator.php:115 Stack trace: #0 D:\wamp\www\magento2\vendor\magento\framework\Code\Generator\Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\\Swatche...') #1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\\Swatche...') #2 [internal function]: spl_autoload_call('Magento\\Swatche...') #3 D:\wamp\www\magento2\vendor\magento\framework\ObjectManager\Relations\Runtime.php(38): class_exists('Magento\\Swatche...') #4 D:\wamp\www\magento2\vendor\magento\framework\Interception\Config\Config.php(153): Magento\Framework\ObjectManager\Relations\Runtime->has('Magento\\Swatche...') #5 D:\wamp\www\magento2\vendor\magento\framework\Interception\Config\Config.php(176): Magento\Framework\Interception\Config\Config->_inheritInterception('Magento\\Swatche...') #6 D:\wamp\www\magento2\vendor\magento\framework\Interception\Config\Config.php(127): Magento\Framework\Interception\Config\Config->hasPlugins('Magento\\Swatche...') #7 D:\wamp\www\magento2\vendor\magento\framework\Interception\Config\Config.php(103): Magento\Framework\Interception\Config\Config->initialize(Array) #8 D:\wamp\www\magento2\vendor\magento\framework\ObjectManager\Factory\AbstractFactory.php(93): Magento\Framework\Interception\Config\Config->__construct(Object(Magento\Framework\ObjectManager\Config\Reader\Dom\Proxy), Object(Magento\Framework\Config\Scope), Object(Magento\Framework\App\Cache\Type\Config), Object(Magento\Framework\ObjectManager\Relations\Runtime), Object(Magento\Framework\Interception\ObjectManager\Config\Developer), Object(Magento\Framework\ObjectManager\Definition\Runtime), 'interception') #9 D:\wamp\www\magento2\vendor\magento\framework\ObjectManager\Factory\Dynamic\Developer.php(89): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Framewo...', Array) #10 D:\wamp\www\magento2\vendor\magento\framework\ObjectManager\ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Framewo...') #11 D:\wamp\www\magento2\vendor\magento\framework\App\ObjectManager\Environment\Developer.php(82): Magento\Framework\ObjectManager\ObjectManager->get('Magento\\Framewo...') #12 D:\wamp\www\magento2\vendor\magento\framework\App\ObjectManagerFactory.php(194): Magento\Framework\App\ObjectManager\Environment\Developer->configureObjectManager(Object(Magento\Framework\Interception\ObjectManager\Config\Developer), Array) #13 D:\wamp\www\magento2\vendor\magento\framework\App\Bootstrap.php(385): Magento\Framework\App\ObjectManagerFactory->create(Array) #14 D:\wamp\www\magento2\vendor\magento\framework\App\Bootstrap.php(232): Magento\Framework\App\Bootstrap->initObjectManager() #15 D:\wamp\www\magento2\index.php(38): Magento\Framework\App\Bootstrap->createApplication('Magento\\Framewo...') #16 {main}

When i refresh page again it works fine. What will be cause of this Exception?


texts:
I have created a custom module to add a custom column to sales_flat_quote and sales_flat_order. I have been successful in creating the columns in the database. The problem is the module also has a observer for event controller_action_predispatch_checkout_onepage_index, but when the event is triggered i get 500 error message, and no error details is displayed.

/app/code/local/JestaSoft/AddTripId/etc/config.xml

<?xml version="1.0"?>
<config>
        <modules>
            <JestaSoft_AddTripId>
                    <version>0.1.0</version>
            </JestaSoft_AddTripId>
        </modules>
    <global>
            <resources>
                    <jestasoft_addtripid_setup>
                        <setup>
                                <module>JestaSoft_AddTripId</module>
                        </setup>
                        <connection>
                                <use>core_setup</use>
                        </connection>
                    </jestasoft_addtripid_setup>
            </resources>
            <fieldsets>
                <sales_convert_quote>
                    <trip_id>
                            <to_order>*</to_order>
                        </trip_id>
                </sales_convert_quote>

                <sales_convert_order>
                        <trip_id>
                            <to_order>*</to_order>
                        </trip_id>
                </sales_convert_order>
        </fieldsets>

            <events>
                <controller_action_predispatch_checkout_onepage_index>
                        <observers>
                            <jestasoft_addtripid>
                                    <class>JestaSoft_AddTripId_Model_Observer</class>
                                    <method>addTripId</method>
                            </jestasoft_addtripid>
                        </observers>
                </controller_action_predispatch_checkout_onepage_index>
            </events>
    </global>
</config>

/app/code/local/JestaSoft/Model/Observer.php

<?php

public function addTripId(Varien_Event_Observer $observer) {
    $item = $observer->getQuote();
    $tripId = Mage::getSingleton('checkout/session')->getNTripId();
    $item->setTripId($tripId);
    $item->save();
    return $this;
}
?>


texts: Cloud hosting and maintain for the inhouse coded community edition?

texts:
We are wondering if Megonto offers cloud hosting and maintains only if we give the already developed community editing project. We have developed our in-house project using Magento's 2 community edition code and we have looking for a hosting provider that offers maintenance and support. So we are wondering if Magento does offer this kind of hosting or do you have any recommended hosting provider that we could get in touch with?

Thank you


texts:
I'm, trying to define and implement observers to catch comments on the checkout page and write them into the database. But when I want to place an order I get the following exception:

  Mage registry key "_singleton/checkoutcomments/observer" already exists

Do I get this error because the model is not called properly?

Here is my code:

The config.xml of the module

<frontend>
    <layout>
        <updates>
            <checkoutcomments>
                <file>practice/checkoutcomments.xml</file>
            </checkoutcomments>
        </updates>
    </layout>

    <events>
        <controller_action_predispatch_checkout_onepage_saveOrder>
            <observers>
                <save_checkout_comments>
                    <class>checkoutcomments/observer</class>
                    <method>prepareCheckoutComment</method>
                </save_checkout_comments>
            </observers>
        </controller_action_predispatch_checkout_onepage_saveOrder>

        <sales_order_place_after>
            <observers>
                <save_checkout_comments>
                    <class>checkoutcomments/observer</class>
                    <method>saveCheckoutComment</method>
                </save_checkout_comments>
            </observers>
        </sales_order_place_after>
    </events>

</frontend>

My Observer.php

    <?php

class Practice_CheckoutComments_Model_Observer
{

    public function prepareCheckoutComment ($observer)
    {
        $message = $observer->getControllerAction()
            ->getRequest()
            ->getPost('checkoutcomments');
        Mage::getSingleton('core/session')->setCheckoutComment($message);
    }

    public function saveCheckoutComment ($observer)
    {
        $order = $observer->getOrder();
        $message = Mage::getSingleton('core/session')->getCheckoutComment(true);

        if (!$order || empty($message)) {
            return;
        }

        $commentModel = Mage::getModel('checkoutcomments/comment');
        $commentModel->setOrderId($order->getId())
            ->setComment($message)
            ->save();
    }
}

?>


texts: Importing attributes to a new magento installation

texts:
What are the tables I need to dump to be able to import them in a new installation?
I need this to avoid reinserting all the custom attributes for every new Magento installation.
thanks


texts: Customer Registration with email address and password only

texts:
There is a requirement to fast registration process by removing personal information field ( like -First Name and Last Name) from customer registration form and allow to register only by entering email and password.

What will be the effects of removing personal information fields?

Can we recommend such type of changes in Magento?


texts: How to show specific category products in cart page?

texts: I would like to show specific category products in a cart page when one of its product from that category is added to the cart and also would like to show all those products in carousel. Can anyone please guide me on this? Thanks


texts: How to add sales rule action fieldset in customer group area

texts:
I want to add sales rule fieldset to customer group form using custom module.
can any one please guide me on this how to add this sales rule condition form under customer group edit form and save this info in custom table for later use on frontend.
Here is how i would like to display in customer group form.

Problem is that sales rule is build using uicomponent and customer group form is build using generic class extended with \Magento\Backend\Block\Widget\Form\Generic
So how can we add uicomponent in generic form
Also how to validate this condition on frontend please.


texts: Disable Data Integrity Step in Migration

texts:
I got below error while I am trying to Migrate from Magento1 to Magento2.

  Foreign key (FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID) constraint fails on source database. Orphan records id: 121,163,164 from eav_entity_attribute.attribute_id has no referenced records in eav_attribute

I would not like to delete records from Magento 1 database.

I got to keep the records, disable the Data Integrity Step by modifying the Data Migration Tool’s config.xml. in this link to solve this error.

How can I disable the Data Integrity Step?


texts: How to remove discountcode from checkout and transactional emails?

texts:
I'm working with magento 1.9.3.4 and I wold like to remove the Discount code (e.g. COUPONCODE1) from showing on the checkout and transnational emails. Is this possible?

Is there a controller/model/block/template that i should check for this?
So far I only saw the discount amount being called and not the code itself. I'm not sure if i'm doing something wrong.


texts: Magento 2 How to Clear Content Staging Dashboard?

texts:
Anyone Magento 2 EE 2.3.5 How to Clear Content Staging Dashboard?
How to remove/delete/clear content staging dashboard any idea?
I am trying to figure this out for many hours, please let me know If possible?


texts: display stock information to logged customer only in Magento 2?

texts: I want to display stock only to logged customers in product page. can you guide me how can I do and in which file?


texts: How to stop product image changing with wrong swatch?

texts:
I have my swatches setup with labels so that when a colour is called, it displays the right image. My problem is with my size attributes, they revert my image back to the base image when selected.
There is no way I could add each image to the simple product, I have over 20,000 variations.

Is there not a simple way to say, if the swatch is selected and it does not match a label then do nothing. (instead of reverting to base image)
Alternatively I thought I could also have....If anything other than my Product Colour swatch is selected, then do nothing.

I don't know where I would implement this or how I would do it. I need help.


texts: Magento 2.3.5 - Large table scconnector_google_feed_cl

texts:
We found a 'large' table on our completely clean Magento 2.3.5 store, that we run some indexes after we added a few products.
Is there anyone who can tell us what table scconnector_google_feed_cl is for and what it is creating?
Can we remove or truncate it for example?


texts: .pdf opening 403 Forbidden issue in Magento 2.3

texts:
I have an issue in opening .pdf file
Forbidden
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


texts: get config data from current store not from default config (from admin area)

texts:
i want to get config data from current store not from default config so for example if i change Table rates title from "Table Rate" to "Something Else" in main webisite config and save it, i can see these changes also in Default store view and that is ok, but if i want to get this title "Something else" i always get title "Table Rates" i am using this code to check it:

$title = Mage::getStoreConfig('carriers/tablerate/title',Mage::app()->getStore());
            var_dump($title);
            die();

and it always prints "Table Rate", i have also tried without 'Mage::app()->getStore())' cause i read there that "The getStoreConfig() method looks like return self::app()->getStore($store)->getConfig($path);, so it get the same if you don't pass the second param - 'Mage::app()->getStore()'." so can anyone tell me how to get config from main website not from default config?

p.s. i have my own shipping module with all config and cerrier and etc files, table rates is just a sample that is the same thing happens to the table rates also.


texts: Magento2 - Need to add External Images from external media host. How the image path is stored in DB?

texts:
The Magento OOTB functionality has the option of adding images from the external media host.

I just need to use both locally stored images and images from different media hosts instead of one media host.


texts: I tried today to go to admin page and got this error

texts:
Warning: include(Mage/Admin/Model/Observer.php): failed to open stream: No such file or directory  in /home/abogacec/public_html/dycgarage.ro/lib/Varien/Autoload.php on line 96

#0 /home/abogacec/public_html/dycgarage.ro/lib/Varien/Autoload.php(96): mageCoreErrorHandler(2, 'include(Mage/Ad...', '/home/abogacec/...', 96, Array)
#1 /home/abogacec/public_html/dycgarage.ro/lib/Varien/Autoload.php(96): Varien_Autoload::autoload()
#2 [internal function]: Varien_Autoload->autoload('Mage_Admin_Mode...')
#3 [internal function]: spl_autoload_call('Mage_Admin_Mode...')
#4 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Model/Config.php(1346): class_exists('Mage_Admin_Mode...')
#5 /home/abogacec/public_html/dycgarage.ro/app/Mage.php(462): Mage_Core_Model_Config->getModelInstance('admin/observer', Array)
#6 /home/abogacec/public_html/dycgarage.ro/app/Mage.php(476): Mage::getModel('admin/observer', Array)
#7 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Model/App.php(1316): Mage::getSingleton('admin/observer')
#8 /home/abogacec/public_html/dycgarage.ro/app/Mage.php(447): Mage_Core_Model_App->dispatchEvent('controller_acti...', Array)
#9 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Controller/Varien/Action.php(528): Mage::dispatchEvent('controller_acti...', Array)
#10 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Adminhtml/Controller/Action.php(160): Mage_Core_Controller_Varien_Action->preDispatch()
#11 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Controller/Varien/Action.php(408): Mage_Adminhtml_Controller_Action->preDispatch()
#12 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#13 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#14 /home/abogacec/public_html/dycgarage.ro/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#15 /home/abogacec/public_html/dycgarage.ro/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#16 /home/abogacec/public_html/dycgarage.ro/index.php(92): Mage::run('', 'store')
#17 {main}


texts: How to set custom options in an quote to create an order?

texts:
Here is the part of my code to create an order programmtically:

    //add products
$this->_getOrderCreateModel()->resetShippingMethod(true);
if (is_array($post['order']['add_products']))
    $this->_getOrderCreateModel()->addProducts($post['order']['add_products']);

$this->_getOrderCreateModel()
        ->saveQuote();

//apply custom product price
$productsData = array();
foreach ($this->_getOrderCreateModel()->getQuote()->getItemsCollection() as $item) {
    $productId = $item->getproduct_id();
    foreach ($object['products'] as $srcProduct) {
        if ($productId == $srcProduct['product_id']) {
            if (Mage::getStoreConfig('tax/calculation/price_includes_tax') == 1) {
                $item->setCustomPrice($srcProduct['priceInclTax']);
                $item->setOriginalCustomPrice($srcProduct['priceInclTax']);

            } else {
                $item->setCustomPrice($srcProduct['priceExclTax']);
                $item->setOriginalCustomPrice($srcProduct['priceExclTax']);

            }
        }
    }
}

I've tried to add the following code to above code but not work

$product = Mage::getModel('catalog/product')->load($product_id);
$item->addOption(new Varien_Object(
    array(
        'product' => $product,
        'code' => '8',
        'value' => '5'
    )
));

anyone knows how to do that?


texts: Magento auto login from external site, same domain

texts:
I have problem with logging into magento from my external site. I have done researches about it, and tried several codes on web but after logged in from my external site, it won't automatically logged into the magento website.

this is my log in form.

<?php

if (isset($_POST['login'])) {

function validatePassword($password, $hash) {
$hashArr = explode(':', $hash);
switch(count($hashArr)) {
case 1:
    return md5($password) === $hash;
case 2:
    return md5($hashArr[1].$password) === $hashArr[0];
}
return false;
}

$apiUrl = 'http://magentowebsite.com/api/soap/?wsdl';
$apiUser = 'USER API';
$apiKey = 'PASSWORD';

if(isset($_POST['login'])) {
try {
$client = new SoapClient($apiUrl);
$session = $client->login($apiUser, $apiKey);
} catch (Exception $e) {
echo $e;
exit;
}

//Lookup customer record
list($customer) = $client->call(
$session,
'customer.list',
array(
    array(
        'email' => addslashes($_POST['login']['username'])
    )
)
);
if(is_array($customer)) {
if(validatePassword($_POST['login']['password'],     $customer['password_hash'])) {

    require_once 'app/Mage.php';
    umask(0);
    Mage::app()->setCurrentStore('default');

    Mage::getSingleton("core/session", array("name" => "frontend"));
    $session = Mage::getSingleton("customer/session");

    //Log out any existing sessions
    if(!$session->isLoggedIn()) {
        $session->logout();
    }

    //Log user in
    $login = Mage::getSingleton('core/app')->getRequest()->getPost('login');
    $session->login($login['username'], $login['password']);

    header('Location: http://www.magentowebsite.com/');
    exit;

    exit;
} else {
    header('Location: http://www.myexternalloginsite.com?ref=invalid');
    exit;
}
}
else {
    header('Location: http://www.myexternalloginsite.com?ref=invalid');
    exit;
}
}

}

?>

<form action="http://www.myexternalloginsite.com" method="post">

Username
<input id="login_username" type="text" value="" name="login[username]" />

Password
<input id="login_password" type="password" value=""  name="login[password]"  />

<input type="submit" value="log in" />

</form>

The form works well, I mean it can load and then redirect me to the magento site. but not logged in as the user using previous credentials. What am i missing here? is there any configuration I need to change in the magento admin panel?

thank you


texts:
I see some conflicting information on the internet and in 3rd party modules alike - is it a requirement or best practice to return $this at the end of an observer method?

E.g.:

MyCompany_Module_Model_Observer.php

public function salesOrderSaveAfter($observer){
    //do stuff
    return $this;
}


texts: Magento 2 : Getting rid of meta description tag on product pages

texts:
I am using editor for product description and there are HTML tags in them. Magento uses product description in product page meta tag description. My designs are going weird.

Here is the meta tag description.

<meta name="description" content="
ABDE product

Also available in Black</st"/>
<meta name="keywords" content="Magento, Varien, E-commerce"/>

Ref Image : Click here

How to fix this issue. Any issue would be appreciated.


texts: Magento 1.9 How can i add the category name and category id in the canonical url

texts:
In magento 1.9 I am trying to get the canonical URL for the category
In the view source, I am getting as
<link rel="canonical" href="https://domain/categoy" />

I wanted to add the category id also in it can I do that?
can anyone help me how I can add the category Id to the canonical
currently, I am getting as
<link rel="canonical" href="https://domainname/caregotyname" />

i also wanted to add the categoty id i don't the correct syntax but something like this is possible
<link rel="canonical" id='categoty_id' />

I am not sure but something like this


texts: How to show sales order details in magento from one store to another magento store

texts:
i have four Magento site. example

www.abc.com
www.cde.com
www.ads.com
www.example.com

now i want to show all sales order from all four site to new in magento site  example www.xyz.com. is it possible if yes then how.


texts:
we are using Magento v. 1.9.2.1 and set up two languages. Our customer wants to deactivate a few products for a specific language. Even deactivating a category would be fine. But as always, its not that easy. If we deactivate the product for one language, its deactivated for the other as well. Same with the category.
Is there a way to go around this problem, or an extension.

Thanks for any hint or help.


texts: What is the layout file for Magento_Sales LoadBlock controller

texts:
Main question is:
What is the layout file for

  \Magento\Sales\Controller\Adminhtml\Order\Create\LoadBlock

controller?

Here is some background why I needed that:
I am making custom module that will have similar functionality as Magento_Sales modules (pages where admin can create new order). I've copied all needed files form Magento_Sales module, and at the end I can't figure out what is layout for

  \Magento\Sales\Controller\Adminhtml\Order\Create\LoadBlock

As you can see on github Link there is no layout file sales_order_create_loadblock.xml

In LoadBlock execute method
Link
there is some code for adding handle

foreach ($blocks as $block) {
  $resultPage->addHandle('sales_order_create_load_block_' . $block);
}

for each block, but I can't find where the main layout file is included.


texts:
I Checked my website in the gtmetrix and i got one of the following suggestion

  This page has 95 external Javascript scripts. Try combining them into
  one.

  This page has 6 external stylesheets. Try combining them into one.

How can i solve this.I had google lot but still not got success.


texts: How can I inject data into a class using dependency injection XML?

texts:
I'm under the impression that we can inject data into classes using di.xml and the $data array dependency. I'm struggling with getting it working however. Am I not understanding the concept correctly? Or am I missing some configuration?

Below is my (simplified) code.

etc/frontend/di.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="DannyNimmo\Subcategories\Block\ListCategory">
        <arguments>
            <argument xsi:type="array" name="data">
                <item xsi:type="string" name="test">test</item>
            </argument>
        </arguments>
    </type>
</config>

Block/ListCategory.php:

<?php

namespace DannyNimmo\Subcategories\Block;

class ListCategory
    extends \Magento\Framework\View\Element\Template
    implements \Magento\Framework\DataObject\IdentityInterface
{

    public function __construct (
        \Magento\Framework\View\Element\Template\Context $context,
        array $data = []
    ) {
        parent::__construct($context, $data);
        var_dump($data);
    }

}

Edit: I should say that I am seeing an empty array array(0) { } as the output.


texts:
I am facing following issue at my local environment I tried every solution available on internet but unable to fix this issue.

 I am using LAMP PHP 7.1.28-1+ubuntu18.04, Apache/2.4.39

I had created virtual host for: www.fytm.com
This issue is only at my local url if I change it to any live server url it works.

SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://www.fytm.com/soap/default?wsdl&services=storeStoreRepositoryV1,catalogAttributeSetRepositoryV1,catalogProductAttributeRepositoryV1,catalogProductRepositoryV1,catalogProductAttributeMediaGalleryManagementV1,catalogProductCustomOptionRepositoryV1,salesOrderItemRepositoryV1,salesOrderRepositoryV1' : Couldn't find end of Start Tag appinfo line 2


texts:
I'm building rest API to get a product using its sku, but it give me this message "Request doesn't match any route" although the url in webapi.xml file is the same in the request.
magento version is 2.1.15

here is module.xml -

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">

   <module name="Bit68_Mobileapp" setup_version="2.1.15"/>

</config>

here is di.xml -

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<preference for="\Bit68\Mobileapp\Api\Product\ProductInterface" type="\Bit68\Mobileapp\Model\Product\Product"/>
</config>

here is the webapi.xml -

<?xml version="1.0"?>

<route url="/V1/status" method="GET">
    <service class="\Bit68\Mobileapp\Api\Product\ProductInterface" method="getStatus"/>
    <resources>
        <resource ref="anonymous"/>
    </resources>
</route>

here is the interface  -

<?php

namespace Bit68\Mobileapp\Api\Product;

 interface ProductInterface{
/**
 * get test Api data.
 *
 * @api
 *
 * @return string
 */
public function getStatus();}?>

and that is the implementation for the interface

<?php

namespace Bit68\Mobileapp\Model\Product;

use Bit68\Mobileapp\Api\Product\ProductInterface;

class Product implements ProductInterface{
/**
* @var \Magento\Catalog\Model\ProductRepository
*/
private $productRepository;

/**
* @param \Magento\Catalog\Api\ProductRepositoryInterface
*/
public function __construct(

    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository

) {
    $this->productRepository = $productRepository;
}

/**
* get test Api data.
*
* @api
*
* @return string
*/

function getStatus()
{
    //echo "helllloooo";
    $product=$this->$productRepository->get('pro');

    return "found";
}

}

?>

my request is http://127.0.0.1/yourParts/rest/V1/status/Authorization:Bearer_TOKEN


texts: Overriding the product template, where to find the default file?

texts:
Inherited a project and am not familiar with Magento enough to know where to find things.

There are a bunch of errors on our product detail page (app/design/frontend/{name}/{dir}/Magento_Catalog/templates/product).

Just as a quick example, in my browser's console I see errors that the Product is not defined, VerienForm is not defined and so on. These are javascript errors for missing objects, for whatever reason. What I would like to do is compare this template to working/known product view page.

Is this a completely custom file or is there a default/sample provided?

Aaron


texts: Remove shipping method auto apply from cart in magento2

texts:
I have installed Webshop matrix rate extension and its working fine.

Whenever i add product to the cart, Automatically it takes the first shipping method and applies the shipping price for the cart total.

So is it possible to remove shipping method section from the cart page ?


texts: How to add href to custom attribute in customer grid?

texts:
I have created the custom attribute to upload the business proof file during registration. I am able to store the file in /pub/media and file name in Database and the file name also displaying in customer grid.

How to access the file from admin? Shall we create the href to that column in customer grid to access the file. I have added the screen shot below for reference.