texts: Is it safe to change order status before save?

texts:
I have Collect In Store extension installed on Magento 1.9.0.1. The client wants a different default order status when this shipping method is chosen - it should be Processed instead of Pending. I could change the status on sales_order_place_after event like:

public function changeOrderStatus($event)
{
    $order = $event->getOrder();

    if ($order->getData('shipping_method') == 'collectinstore_collectinstore') {
        $order->setState(Mage_Sales_Model_Order::STATE_PROCESSING, true);
        $order->save();
    }
    return $this;
}

But in this case the order's default status still will be  Pending and later changed to Procssed. Also the customer will receive an email for status Pending but not for status Processed. So is it safe enough to change the order status before saving the order (sales_order_save_before event)? And if so, how I can stop the email notification on status Pending and send it when changing the status to Processed? On the other side it is not mentioned anywhere on the email (New order email) that the status is Pending or something else. So it seems okay to send it the first time and then just change the status to Processing but I'm still not sure if it's good enough.

Edit: What I was trying to achieve has nothing to do with changing the status of the order. My question is somehow wrong. Accepted R.S's answer below because he helped me to understand that I don't have to change the status with observer at all.


texts: How to properly save EAV attributes for all store views at once?

texts:
We have right now three store views with different locales and plan to extend their quantity in a future.

We encountered issue when some attributes (price, name, etc) are properly received when we saving them with storeId = 0, then, according to

app/code/core/Mage/Eav/Model/Entity/Abstract.php:992

the sql query like this is used to get these attributes:

 SELECT `attr_table`.* FROM `catalog_product_entity_text` AS `attr_table`
 INNER JOIN `eav_entity_attribute` AS `set_table`
 ON attr_table.attribute_id = set_table.attribute_id AND set_table.attribute_set_id = '4'
 WHERE (attr_table.entity_id = '50') AND (attr_table.store_id IN (0, 2))

As you can see, these is actually works for admin store if  attr_table.store_id = 0. But in some cases, like with setting default image for product (image, small_image and thumbnail attributes) or using tag/tag model it is impossible to use storeid = 0.

So, the question is - how in this cases it is possible to update product attributes for all store ids at once without iterating over all store ids like this :

foreach ($stores as $store) {
        Mage::app()->getStore()->setId($store);
        $product = Mage::getModel('catalog/product')->load($product->getId());
        $product->setStoreId($store);
        $product->hasDataChanges(true);
        Mage::getSingleton('catalog/product_action')
               ->updateAttributes(array($product->getEntityId()),
                                        $attributes, $store);
    }

and how if I have for example product with some $id:

    $product = Mage::getModel('catalog/product')->load($id);
    $product->setName('newName')->save();
    // how to save this model for all store views  at once, without using setStoreId(0) ?

Thanks !


texts: How to add a mass action via xml in Magento 2?

texts:
Scenario:
I have a custom CRUD module and I need to have a mass action in the admin grid that I can use to mass update the status for example.
The module uses the new xml grid system from Magento 2 (see as example app/code/Magento/Sales/view/adminhtml/layout/sales_order_grid_block.xml).

Issue:
I can add any mass action item that does not require an additional input.

            <block class="Magento\Backend\Block\Widget\Grid\Massaction" name="[module].[entity].grid.massaction" as="grid.massaction">
                <arguments>
                    <argument name="massaction_id_field" xsi:type="string">[entity]_id</argument>
                    <argument name="form_field_name" xsi:type="string">[entity]_ids</argument>
                    <argument name="use_select_all" xsi:type="string">1</argument>
                    <argument name="options" xsi:type="array">
                        <item name="delete" xsi:type="array">
                            <item name="label" xsi:type="string" translate="true">Delete</item>
                            <item name="url" xsi:type="string">[module_route]/[entity]/massDelete</item>
                            <item name="confirm" xsi:type="string" translate="true">Are you sure you want to delete the items?</item>
                        </item>
                    </argument>
                </arguments>
            </block>

I cannot add a mass action item that requires an additional select. In the example above, I need a select with 2 statuses enabled & disabled.

In Magento 1 this was possible via _prepareMassaction method in the grid block:

    $this->getMassactionBlock()->addItem(
        'status',
        array(
            'label'      => Mage::helper('[module]')->__('Change status'),
            'url'        => $this->getUrl('*/*/massStatus', array('_current'=>true)),
            'additional' => array( //this allows an additional select.
                'status' => array(
                    'name'   => 'status',
                    'type'   => 'select',
                    'class'  => 'required-entry',
                    'label'  => Mage::helper('[module]')->__('Status'),
                    'values' => array(
                        '1' => Mage::helper('[module]')->__('Enabled'),
                        '0' => Mage::helper('[module]')->__('Disabled'),
                    )
                )
            )
        )
    );

Magento 1 result:

Question:
How can I get the same result in Magento 2 (0.74.0-beta1) via xml grid definition?


texts: Configurable Product Collection and variants

texts:
Is there any way I can fetch all the variants of a configurable products from a product collection in Magento 2? Thanks!

I would like to return the products including the attribute options and and child products as well. So far, I have the code from \Magento\Catalog\Model\ProductRepository::getList()

public function getList(\Magento\Framework\Api\SearchCriteriaInterface $searchCriteria)
{
    /** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $collection */
    $collection = $this->collectionFactory->create();
    $this->extensionAttributesJoinProcessor->process($collection);

    foreach ($this->metadataService->getList($this->searchCriteriaBuilder->create())->getItems() as $metadata) {
        $collection->addAttributeToSelect($metadata->getAttributeCode());
    }
    $collection->joinAttribute('status', 'catalog_product/status', 'entity_id', null, 'inner');
    $collection->joinAttribute('visibility', 'catalog_product/visibility', 'entity_id', null, 'inner');

    //Add filters from root filter group to the collection
    foreach ($searchCriteria->getFilterGroups() as $group) {
        $this->addFilterGroupToCollection($group, $collection);
    }
    /** @var SortOrder $sortOrder */
    foreach ((array)$searchCriteria->getSortOrders() as $sortOrder) {
        $field = $sortOrder->getField();
        $collection->addOrder(
            $field,
            ($sortOrder->getDirection() == SortOrder::SORT_ASC) ? 'ASC' : 'DESC'
        );
    }
    $collection->setCurPage($searchCriteria->getCurrentPage());
    $collection->setPageSize($searchCriteria->getPageSize());
    $collection->load();

    $searchResult = $this->searchResultsFactory->create();
    $searchResult->setSearchCriteria($searchCriteria);
    $searchResult->setItems($collection->getItems());
    $searchResult->setTotalCount($collection->getSize());
    return $searchResult;
}

However, this collection does not retrieve the attribute options from configurable products.


texts: hide update and cancel button after click on updtae button

texts:
we are using this code for updating the price .

once we click on "update" button its displaying as like in image .

what we need is once we click on "update" buttton, than " Update" and "cancel" button should hide.

for "cancel" button, its working fine. once we click on "cancel" buttton, than " Update" and "cancel" button is hiding.

    <?php //echo $products->getPrice(); ?>

        <span id="valueprice_<?php echo $products->getId(); ?>"><?php echo $products->getPrice(); ?>
    <input type = "text" id = "price_<?php echo $products->getId(); ?>" onkeydown="validateNumbers(event)" "name = "price" value = "<?php echo $products->getPrice(); ?>" style = "display:none"/>

    <span class="label wk_action" id="edit_link_<?php echo $products->getId(); ?>">
<img onclick="showFieldPrice('<?php echo $products->getId(); ?>'); return false;"
src="<?php echo $this->getSkinUrl('marketplace/images/icon-edit.png'); ?>"/>

    <p id="updatedprice_<?php echo $products->getId(); ?>" style = "display:none;color:red;">Updated

    <button id="price_update_button_<?php echo $products->getId(); ?>" class="button wk_mp_btn1" onclick="updateFieldPrice('<?php echo $products->getId(); ?>'); return false;" style="display:none" >
                <?php echo $helper->__('Update') ?>
                                                        </button>
    <button id="price_reset_button_<?php echo $products->getId(); ?>" type="reset" class="cancel" onclick="hideResetPrice('<?php echo $products->getId(); ?>'); return false;" style="display:none" >
<?php echo $helper->__('Cancel') ?>
                                                        </button>

script


texts: Magento 2 https ssl missing navigation menu

texts:
My problem is when I load the home page with https, my navigation menu completely disappears.

In STORES > Configuration > GENERAL > Web, my Base URLs set to http://www.ozonesmoke.com/, and Base URLs (secure) set to https://www.ozonesmoke.com/.

Also my Use Secure URLs on Storefront is set to YES.
For some reason, not sure if it is intended, but the only time page loads with https is at the cart.

When I change Base URLs from http:// to https://, Magento 2 hides the navigation bar, and instead I see this tag inside, where originally supposed to be my site URL links.

<esi:include src="https://www.ozonesmoke.com/page_cache/block/esi/blocks/[%22catalog.topnav%22]/handles/[%22default%22,%22cms_index_index%22,%22cms_page_view%22,%22cms_index_index_id_home%22]/"></esi:include>

Is this a bug, or how can I set Magento, to always load pages with HTTPS?

Any help is greatly appreciated.

At the moment I running Magento 2.0.2 and Varnish-4.0.3


texts: Magento customer collection with confirmed users

texts:
I want to list all the confirmed users with fistname,lastname ect..

My query:

$collection = Mage::getModel('customer/customer')->getCollection();
$collection->addAttributeToSelect(array('userid','firstname','lastname','profile_image','specialist','latitude','free_consult','longitude','sponsored_list','email'));
$collection->addAttributeToFilter('confirmation', array('null' => true));
$collection->addAttributeToFilter('group_id',Federallawyer_Customer_Helper_Data::LAWYER);

But the result is zero,can you please suggest your answer.


texts: How to display custom field in soap api v2 method salesOrderInfo

texts:
I have created custom attribute Barcode. Each simple product has filled unique barcode value.

Where and what should I change to display it for each order items in output of method salesOrderInfo?

I have Magento ver. 1.9.0.1


texts: magento 2.2.5 turn back to home when i change store view

texts:
i've an issue on magento 2.2.5. I've created two store view it/en,  when I'm on product page and change store view from it to en and vice versa,
I'm redirected to the home page. Someone can help me? Thanks.


texts: Mini cart, price is showing only for one product

texts:
I added new functionality to add multiple products in cat, but when I add more products and go in mini cart on header, only first added product have price and other are with price 0.00. In the modified cart controller I have added

$cart->getQuote()->setTotalsCollectedFlag(false);

and after

$cart->save();

I have  added update cart

Mage::getSingleton('checkout/session')->setCartWasUpdated(true);

This piece of code, it gives qty of products but not and the prices, still showing only price for one product. And others are 0.00. Can anyone help Please.


texts: Magento 1 New Media Image attribute not showing up in product variable

texts: I've created an new image attribute, its purpose is to serve as a rollover option. I've implemented my version of it but I've realised on the catalog/product/list.phtml the others attribute come up in the data but not the newly created one. Why doesn't it show the new attribute in the data? Is that normal?


texts: Magento 2: Ajax Custom Pagination using controller collection

texts:
I have implement custom ajax pagination and collection is returning from controller.
I have trying pagination first time render pagination from block and set collection limit 5. After second time when click on any page then send the page number to controller via ajax and collection is filtering fine and updated collection in front side.
But I have faced issue in front custom pagination html it is not rendering properly. For example I have 55 record and limit is 5 then correct html should be

1 2 3 4 5 Next

when click on 5 it should be

Previous 6 7 8 9 10 Next

when click on 10 it should be

Previous 11

Any have idea how to set custom pagination html dynamic.
Any help would be appropriated. Thanks.


texts: Get collection of products of all stores

texts:
It is possible to get in only one collection the list of products from all stores (with different translations of the products attributes)?

Thanks for help


texts:
I created an plugin for afterGetProductPriceHtml() and it works so far. My di.xml:
<?xml version="1.0"?>
<config>
    <type name="Magento\Catalog\Block\Product\AbstractProduct">
      <plugin name="add_streichpreis" type="MyVendor\MyModule\Plugin\Streichpreis" sortOrder="1" disabled="false" />
    </type>
</config>

And the plugin:
<?php
namespace MyVendor\MyModule\Plugin;

class Streichpreis
{
    public function afterGetProductPriceHtml(
        \Magento\Catalog\Block\Product\AbstractProduct $subject,
        $result,
        \Magento\Catalog\Model\Product $_product
    ) {
        $streichpreistyp=$_product->getAttributeText('streichpreistyp');
        $basePrice = $_product->getPriceInfo()->getPrice('regular_price');
        $regularPrice = $_product->getPriceInfo()->getPrice('regular_price')->getValue();
        $specialPrice = $_product->getPriceInfo()->getPrice('special_price')->getValue();

        $out="";
        if ($streichpreistyp!="" && $specialPrice < $regularPrice) {

            $displayregular = number_format($regularPrice, 2, ',', '.')." €";
            $streichpreistyp=''.$streichpreistyp.'';
            $displayregular=''.$displayregular.'';
            $percent=(($regularPrice - $specialPrice) / $regularPrice) * 100;
            $percent=round($percent);
            $percent='-'.$percent.'';
            $out=$streichpreistyp.$displayregular.$percent;
        }
        return $result.$out;
    }
}

The part, that I am not really proud of is this:
$displayregular = number_format($regularPrice, 2, ',', '.')." €";

How can I incect another class into the plugin?
To get the formatted price, I need to use
\Magento\Framework\Pricing\PriceCurrencyInterface
to format the price, but I am not able to add a __construct function into the plugin. What is the correct way to use another class in a plugin?


texts:
My configurable product drop downs and options are not showing on the Frontend.
This happened on Friday.  I then had my host restore the database and all was OK. However, after 24 hours of no problems the issue is back again.  It appears to be ALL configurable products. See link below.

Can any one help?  Thanks in advance.
Example Configurable on site

Just noticed that the console on Firefox shows the js error ReferenceError: optionsPrice is not defined. I assume this is related.


texts: Integrity constraint violation: 1048 Column 'entity_id' cannot be null, query was: INSERT INTO `catalog_product_entity`

texts: when i try to add new product i get this error : SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'entity_id' cannot be null, query was: INSERT INTO catalog_product_entity (entity_id, attribute_set_id, type_id, sku, has_options, required_options, created_at, updated_at) VALUES (?, ?, ?, ?, ?, ?, ?, ?)??? from where it comes and how to fix it please


texts: display prices including the TAX magento 2.3?

texts:
How do I configure to display prices including the TAX magento 2.3 ?

Please check screen short.


texts: I am working on http://rojudeal.in/ website. Now my website is not opening. it shows following.


texts: Magento 2 PHP Fatal error: Uncaught PDOException: SQLSTATE[08004] [1040] Too many connections

texts:
When I run a script for upload products more than 5000. after 152 products upload showing
below error. How can I upload thousand of products from csv without error?

  Error: PHP Fatal error:  Uncaught PDOException: SQLSTATE[08004] [1040]
  Too many connections in
  C:\xampp\htdocs\magento23\vendor\magento\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php:128
  Stack trace:
  C:\xampp\htdocs\magento23\vendor\magento\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php(128):
  PDO->__construct('mysql:host=loca...', 'root', 'password', Array)
  C:\xampp\htdocs\magento23\vendor\magento\zendframework1\library\Zend\Db\Adapter\Pdo\Mysql.php(111):
  Zend_Db_Adapter_Pdo_Abstract->_connect()
  C:\xampp\htdocs\magento23\vendor\magento\framework\DB\Adapter\Pdo\Mysql.php(406):
  Zend_Db_Adapter_Pdo_Mysql->_connect()
  C:\xampp\htdocs\magento23\vendor\magento\zendframework1\library\Zend\Db\Adapter\Abstract.php(460):
  Magento\Framework\DB\Adapter\Pdo\Mysql->_connect()
  C:\xampp\htdocs\magento23\vendor\magento\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php(238):
  Zend_Db_Adapter_Abstract->query('SELECT `store_w...', Array)
   C:\xampp\htdocs\magento23\vendor\magento\framework\DB\Adapter\Pdo\Mysql.php
  in
  C:\xampp\htdocs\magento23\vendor\magento\zendframework1\library\Zend\Db\Adapter\Pdo\Abstract.php
  on line 144


texts:
I have a slider on this website: https://sportinngerritsen.nl/ and I'm trying to make it editable for the user through static blocks, but when I do this, it displays the slider like this: http://sportinn.portalserver.nl/.

I noticed that when I add the following HTML that is needed for the slider to the static block:

Bespanmachine nodig

De badminton collectie

Tennissnaren

It automatically changes it to this after I updated the HTML:

Bespanmachine nodig

De badminton collectie

Tennissnaren

Hence, it removes the <a href="javascript:;". Does anyone know why this works when I paste it in page.phtml but doesn't when I use it in a static block? I recently updated from 1.6.2 to 1.9.2.1 and it did work before the update.


texts: Magento 2: Product page popup on image click

texts:
Is there any possbilty for the product page pop up on click on image in Magento 2 ?

Thanks


texts: Problems with Elasticsearch install Ubuntu

texts:
I have installed on my Magento 2.3 server and an annotation has arrived for me to install Elasticsearch. This is my system:

Ubuntu 18.04
Nginx 1.14.0
MySQL 5.7.25

I have followed these instructions:

https://www.elastic.co/guide/en/elasticsearch/reference/5.2/deb.html

And this is the error that I have:


texts: Magento 2: Override Magento Framework class Not working

texts:
I want to override this class function in Magento 2 \Magento\Framework\HTTP\PhpEnvironment\Request::getServer()
etc/module.xml
<module name="Test_Override" setup_version="1.0.0">
    <sequence>
        <module name="Magento_Framework"/>
    </sequence>
</module>

First I tried using a plugin, but it gives me an error every time I run setup:upgrade:
etc/di.xml
<type name="Magento\Framework\HTTP\PhpEnvironment\Request">
    <plugin disabled="false" name="Test_Override_Plugin_Magento_Framework_HTTP_PhpEnvironment_Request" sortOrder="10" type="Test\Override\Plugin\Magento\Framework\Http\PhpEnvironment\Request"/>
</type>

app/code/Test/Override/Plugin/Magento/Framework/Http/PhpEnvironment/Request.php
declare(strict_types=1);

namespace Test\Override\Plugin\Magento\Framework\Http\PhpEnvironment;

class Request
{
    public function beforeGetServer(
        \Magento\Framework\HTTP\PhpEnvironment\Request $subject,
        $name = null,
        $default = null
    ) {
         return [$name,$default];
    }
}

Error when running setup:upgrade :

Cache frontend 'default' is not recognized. As well as defaultcache is not configured

I tried using the preference method, but it is not working at all
etc/di.xml
<preference for="Magento\Framework\HTTP\PhpEnvironment\Request" type="Test\Override\HTTP\PhpEnvironment\Request" />

app/code/Test/Override/HTTP/PhpEnvironment/Request.php
declare(strict_types=1);

namespace Test\Override\HTTP\PhpEnvironment;

class Request extends \Magento\Framework\HTTP\PhpEnvironment\Request
{
    public function getServer($name = NULL,$default= NULL){
      die('testttt');
      return parent::getServer($name,$default);
    }
}


texts:
We have to Export and Import categories in magento 1.9.
Please help me out how to do this.

Thanks.


texts: Why my block is not overwriting the magento core block?

texts:
I am trying to overwrite a magento's core block but it shows an error like this

Fatal error: Call to a member function addToChildGroup() on a non-object in /opt/lampp/htdocs/magento_new/app/code/core/Mage/Core/Block/Abstract.php on line 815

here is my modules config.xml

<?xml version="1.0"?>
<config>
<modules>
<Pfay_MyProduct>
    <version>1.0.0</version>
</Pfay_MyProduct>
</modules>
<global>
    <blocks>
        <catalog>
            <rewrite>
                 <product_view>Pfay_MyProduct_Block_Catalog_Product_View</product_view>
            </rewrite>
         </catalog>
    </blocks>
</global>
</config>

and my view.php is

<?php

class Pfay_MyProduct_Block_Catalog_Product_View extends Mage_Catalog_Block_Product_View
{
    public function canEmailToFriend()
    {
            return false;
    }
}

What is wrong in this ?


texts: How I Can Add Link In Header For Social Media Icon?

texts:
I am trying to find the option that how I can edit the link of google plus in header.

I find in CMS > Static block but no success, Please help me, How can I edit or add the link


texts:
When i create configure product and selected attribute.
I stuck on this page


texts: Confirmation mail for newsletter in Magento 2

texts:
I am using Magento 2.1.5, and I enabled confirm function in admin.

  Need to Confirm - yes

Now when anyone subscribes, they get confirmation link, but after click on that link,they successfully verify, but they are not getting again success email of subscribe. However, status is changed correctly in admin panel.

This is confirm.php file:

  public function execute()
{
    $id = (int)$this->getRequest()->getParam('id');
    $code = (string)$this->getRequest()->getParam('code');

    if ($id && $code) {
        /** @var \Magento\Newsletter\Model\Subscriber $subscriber */
        $subscriber = $this->_subscriberFactory->create()->load($id);

        if ($subscriber->getId() && $subscriber->getCode()) {
            if ($subscriber->confirm($code)) {
                $this->messageManager->addSuccess(__('Your subscription has been confirmed.'));
            } else {
                $this->messageManager->addError(__('This is an invalid subscription confirmation code.'));
            }
        } else {
            $this->messageManager->addError(__('This is an invalid subscription ID.'));
        }
    }

    $this->getResponse()->setRedirect($this->_storeManager->getStore()->getBaseUrl());
}

}

here the code only for getting message after verify, but here it is not sending mail after verification. What should I change here to send success email after verification email?


texts: Adding the same CSS file twice using action addItem

texts:
I'm working on a responsive site and I'm trying a simple solution to stop serving versions of IE below 9 any responsive related CSS because they don't support media queries.

I have one CSS file which I've added to my local.xml like so:

<action method="addItem"><type>skin_css</type><name>css/layout-large.css</name><params>media="only screen and (min-width: 1024px)"</params></action>

That file wont be loaded by older versions of IE because they don't understand media queries, but as these are the larger layout styles those versions of IE need this CSS. A simple solution to this is to link that file from a conditional IE comment, like so:

<action method="addItem"><type>skin_css</type><name>css/layout-large.css</name><params/><if>lt IE 9</if></action>

This is where the problem starts, Magento just renders the IE conditional link and not the other link even though one has parameters and the other an IF statement.

Is there a way to make Magento load the same CSS file (or a JS file thinking about it) twice from the same location?


texts:
I just want to fetch customer id with email as parameter from the mysql database. How can i hit the sql query to get the customer_id.

 $passphrase = "password";
 $salt = "SC";
 $password = md5($salt . $passphrase) . ":SC";

 $write->query("update customer_entity_varchar set value='$password' where entity_id=$customer_id and attribute_id in (select attribute_id from eav_attribute where attribute_code='password_hash' and entity_type=1)");

This is the code which i been using to update password , I need dynamic customer id.

this is full code

<?php
include('app/Mage.php');
Mage::app();
if($_POST && $_POST["email"])
    {

          $collection = mage::getModel('customer/customer')->getCollection()      ->addAttributeToSelect('email')
         ->addAttributeToFilter('myemail@domain.com')
         ->addAttributeToSort('email', 'ASC');
          var_dump((string)$collection->getSelect());
                         die();

                       $passphrase = "password";
                       $salt = "SC";
                       $password = md5($salt . $passphrase) . ":SC";

                       $write->query("update customer_entity_varchar set value='$password' where entity_id=$customer_id and attribute_id in (select attribute_id from eav_attribute where attribute_code='password_hash' and entity_type=1)");

                      $send_data["success"]=true;
                      $send_data["message"]="Login Success";
                      $send_data["customer_id"]=$customer_id;

    }
    else
    {
            $send_data["success"]=false;
            $send_data["message"]="Enter both Email and Password";
    }
     Mage::getSingleton('customer/session')->loginById($send_data["customer_id"]);
    echo json_encode($send_data);

    ?>


texts:
In Magento 1, you can enable capture options for an invoice by adding

protected $_canCapture = true;

to app\code\core\Mage\Payment\Model\Method\METHODNAME.php

In Magento 2, how can this be done?

I'm trying to do this to the purchase order method so invoices can be created but not marked as paid.


texts:
I am trying to upgrade my magento 2.1 EE to latest version 2.3.1 EE.
But I am getting two issues-
1. PHP memory limit issues.
It shows current limit is 512 M and needs to be 756 M or more.
But after checking on server, memory_limit is 2048 M.

Component dependency issues.


texts:
When attempting to view an order in Magento 2.2.5 I receive the following error...

Order View

Information Changes have been made to this section that have not been saved. This tab contains invalid data. Please resolve this before saving.

This is our first order so can't say how long this problem has been present.  I have tried a test order which also has the same problem.

This is a default install with only m2epro installed, no other modules that don't come as standard and running the default Luma theme.

Has anybody come across this issue? I have googled to no avail

edit: still no solution found


texts:
How to Resize the Image post in Magefan Blog extension in Magento 2?

I have to tried with below solution but it's not worked for me.

https://magefan.com/blog/resize-blog-post-images-programmatically
Magefan blog - images not showing after update

Please Help me to resolve the issue.

Thanks in Advance.


texts: Persistent cart = off, adding 1 product and login results in 12 products in cart

texts:
we are having some issues with sessions it seems. Messages from customers like 'my cart is suddenly empty after login (account)', or 'my cart suddenly has many items after login'. When testing I see something similar.

Situation now

Persistent cart = off
I visit site => cart has 0 items
I add 1 product
Go to checkout and login as regular customer
login results in 12 products in cart (and I am directed to cart instead of next step in checkout)

I would expect

login success, goes to next step in checkout
cart items are as before login (just the 1 product)

How can I set up the behavior that I am expecting. Many thanks!


texts:
I'm new to Magento 2

I have an edited CSS file somewhere in app/design/frontend//web/css/, then I run the deploy static content command.
I can see the new CSS file is already in pub/static/ folder.
But when I access it through the browser, it is still the old one.
This is the old file: http://prntscr.com/mmhltc
And this is the new one when I add the "question mark" at the end of the URL: http://prntscr.com/mmhm4k

Could you please let me know what do I need to see my new CSS file?
My Magento is 2.1.15

I have done the following so far:
 1. delete pub/static/ folder
 2. run the deploy static content command again
 3. clear Magento 2 cache and storage cache
 4. flush CSS static file cache


texts:
I make a request in ajax at the click of the button passing as parameter the id of a certain product to the controller. This controller directs the product id to a helper that adds the same to the cart, but that question is not that important in this case. In this helper I create an array of data with the name of the product, price, the url of the image and the image of that product and return that array to the controller. The controller returns this array to my ajax request. I need this array to be displayed in certain fields in HTML code.

Ajax request:

    function addCartao(product_id){
        alert(product_id);
        $j.ajax({
          type: "POST",
          url: "<?php echo Mage::getUrl('fol_carousel/ajax/teste') ?>",
          data: {
            product_id: product_id
          },
          dataType: 'json',
          cache : false,
          beforeSend: function () {
            alert("beforeSend");
          },
          success: function (retorno) {
            alert('success');
            alert(retorno['name']);
            alert(retorno['price']);
            alert(retorno['media']);
            alert(retorno['imagem']);

            //alert(retorno);
            $j('.item-custom').append('

Here would be the product name
	1	Here would be the price of the product
');
          },
          complete: function () {
            alert("complete");
          },
          error: function (x,y,z) {
            alert("error");
            alert(x);
            alert(y);
            alert(z);
          }
      });
    }

Controller code:

$product_id = $this->getRequest()->getParams();
$dados = Mage::helper('fol_carousel/cartao')->addCustom($product_id);
echo json_encode($dados);

Helper code along with the array I create:

public function addCustom($product_id)
{
    // Get customer session
    $session = Mage::getSingleton('customer/session');
    // Get cart instance
    $cart = Mage::getSingleton('checkout/cart');
    $cart->init();
    // Add a product with custom options
    $product = Mage::getModel('catalog/product')->load($product_id);

    $param = array(
        'product' => $product->getId(),
        'qty' => 1
    );
    $request = new Varien_Object();
    $request->setData($param);
    $cart->addProduct($product, $param);
    // update session
    $session->setCartWasUpdated(true);
    // save the cart
    $cart->save();

    $nome = $product->getName();
    $preco = $product->getPrice();
    $media = Mage::getModel('catalog/product_media_config')->getMediaUrl($product->getThumbnail());
    $img = $media;

    $dados['name'] = $nome;
    $dados['price'] = $preco;
    $dados['media'] = $media;
    $dados['imagem'] = $img;

    return $dados;
}

Note: I do not know if the .append() function would be the correct one in this case, so I'm in need of some help.


texts:
I have Magento 1.9. When I try to add around 150 items to a bundled product, I'm getting the following error message:

  SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or
  update a child row: a foreign key constraint fails
  (rockford_magrock.catalog_product_bundle_selection, CONSTRAINT
  FK_CAT_PRD_BNDL_SELECTION_PRD_ID_CAT_PRD_ENTT_ENTT_ID FOREIGN KEY
  (product_id) REFERENCES catalog_product_entity (`entit)

The funny thing is, when I just add a few at a time, this works.

Is there some memory limit or some PHP variable I am hitting that may be causing this error?

These are all just simple products I am adding to the bundle with an attribute type = "default".

I'm also getting this error in the error log:

  ERR (3): Notice: Undefined index: delete  in
  /home/rockfordjchhh/public_html/app/code/core/Mage/Bundle/Model/Product/Type.php
  on line 320


texts: Fundamentals for debugging a Magento store

texts:
How can I debug my Magento store

This is a question that isn't all too relevant to us now, but had a Magento SE site existed 5 years ago, it probably would have been our first question. For those just getting into Magento, or unfamiliar with it - knowing the fundamentals of debugging can be key to rule out the cause of issues. And despite its irrelevance to us now we're pre-empting this question appearing with a self-answered approach.

Help my site is down!

Is my design at fault?
Is a 3rd party module at fault?
Why can't I see the error?

Each of these questions can readily be answered by following a standardized approach to debugging that even the most basic of users can complete. By means of a process of elimination of the fundamentals of debugging a Magento store.


texts: function to display menu from a set level

texts:
I have a function that retrieves menu data from Magento and outputs it to a javascript front-end.

  public function getMenuData()
    {
        if (!is_null($this->_menuData)) return $this->_menuData;
        $blockClassName = Mage::getConfig()->getBlockClassName('custommenu/navigation');
        $block = new $blockClassName();
        $categories = $block->getStoreCategories();
        if (is_object($categories)) $categories = $block->getStoreCategories()->getNodes();
        if (Mage::getStoreConfig('custom_menu/general/ajax_load_content')) {
            $_moblieMenuAjaxUrl = str_replace('http:', '', Mage::getUrl('custommenu/ajaxmobilemenucontent'));
            $_menuAjaxUrl = str_replace('http:', '', Mage::getUrl('custommenu/ajaxmenucontent'));
        } else {
            $_moblieMenuAjaxUrl = '';
            $_menuAjaxUrl = '';
        }
        $this->_menuData = array(
            '_block'                        => $block,
            '_categories'                   => $categories,
            '_moblieMenuAjaxUrl'            => $_moblieMenuAjaxUrl,
            '_menuAjaxUrl'                  => $_menuAjaxUrl,
            '_showHomeLink'                 => Mage::getStoreConfig('custom_menu/general/show_home_link'),
            '_popupWidth'                   => Mage::getStoreConfig('custom_menu/popup/width') + 0,
            '_popupTopOffset'               => Mage::getStoreConfig('custom_menu/popup/top_offset') + 0,
            '_popupDelayBeforeDisplaying'   => Mage::getStoreConfig('custom_menu/popup/delay_displaying') + 0,
            '_popupDelayBeforeHiding'       => Mage::getStoreConfig('custom_menu/popup/delay_hiding') + 0,
            '_rtl'                          => Mage::getStoreConfig('custom_menu/general/rtl') + 0,
            '_mobileMenuEnabled'            => Mage::getStoreConfig('custom_menu/general/mobile_menu') + 0,
            '_mobileMenuWidthInit'          => Mage::getStoreConfig('custom_menu/general/mobile_menu_width_init') + 0,
        );
        return $this->_menuData;
    }

I've been trying to find a way to modify it so that I can alter the depth of the menu being initially displayed.

I've tried changing the $categories variable over to a call to

Mage::getModel('catalog/category')->getCollection()->addAttributeToSelect('*')->addAttributeToFilter('level', array('eq'=>3))->addAttributeToFilter('parent_id',array('eq' => $parent_cat_id))->load();

to try and force it to show categories at level 3 whose parent is set by the category ID, but for the life of me I just cant crack this at the moment.


texts: Replace instant purchase message with popup (2.2)

texts:
I'm using a custom theme I wrote that derives from magento-blank and was wondering how I might go about replacing the instant purchase message at the top with a popup. Currently, on a mobile device, that message is hard to see, and I'm worried people are going to think it didn't work and click the button a bunch of times.

I can code if need be. I just need a push in the right direction, as I'm still pretty new to Magento. I'm on 2.2.6.

Thanks!


texts: Magento 2 : Limit to recently viewed products

texts:
I want to show  only two recently viewed products in products page.How to add it in layout file in block.I am adding like

    <block class="Magento\Cms\Block\Block" name="recently_viewed" cacheable="false">
           <arguments>
                <argument name="block_id" xsi:type="string">recently_viewed</argument>
           </arguments>
           <argument method="setLimit">
               <argument name="limit" xsi:type="number">2</argument>
           </argument>

       </block>

buts its not working


texts: How to increase auto generated coupon codes limit in cart rule?

texts:
I have used auto generated option in cart rule for coupons but its limit to "11041 records found" How can I increase this limit in magento 2?

Thank you


texts: Magento2 How to resize product images by product id without using resize command

texts:
Does any one know how we can resize product image by product id ?
i do not want to use resize command,becuase it takes much time


texts:
I have added below code to load custom template file from cms.
<p>{{block class="Vendor\Module\Block\Testblock" template="Vendor_Module::test_template.phtml"}}</p>

If template is loaded in xml file i can use cacheable="false" then page will no cached.
so how to add same functionality in cms?
Because i am trying to get logged in customer details. but this is not retrieving since page is cached i guess.
All i am looking to get customer details.
Used below code and injected  this class
 \Magento\Customer\Model\Session

return $this->customerSession->getCustomer();

Can anyone look into this and suggest me.


texts: Magento2.2.5 admin panel not able to get to cms page or static blocks

texts:
when I go into the admin panel and then try to get to any CMS page or static block (in the admin panel) I get a 500 error which is the below error. Also in the admin panel if I try to go to any cart price rule the below error occurs.

Also on the site when you go to any category the top category image does not seem to load.

When I look in the server logs I see the error:

Uncaught exception 'Error' with message 'Cannot instantiate interface Magento\Framework\Config\ReaderInterface' in /vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111


texts: How to get google business reviews and display in my custom phtml file

texts:
I want to show the summary rating and customer review in my phtml file, how to get google business review by using API in a custom module or any best practice pls suggest.
Google Business Review API : https://developers.google.com/my-business/content/review-data#list_all_reviews
Any reference welcome.


texts: Magento soap api to get the updated oders

texts:
Can anyone help me how to fetch the updated orders in magento1.9 using soap api.

Thanks


texts: How can we get automatic related, up-sell & cross-sell products in magento 1.9 without any extension?

texts: I want to display related, up-sell & cross-sell products generated automatically without using any extension?


texts: How to restrict number of users are limited to 10 requests/minute for api call

texts:
I have created custom api for customer module with help of this Link. I want to restrict the number of users to access this api.

Now how Can I restrict number of users are limited to access request/min.

Can you give Any suggestions/Idea on this?

Thanks in advance.


texts: How to delete an eav product attribute programmatically

texts:
i  want to delete a product  attribute  from eav table pragmatically.
I was getting a code which was delete customer attribute.

I want just like this code ,which was delete product attribute.

<?php
error_reporting(E_ALL | E_STRICT);
$mageFilename = 'app/Mage.php';
require_once $mageFilename;
Mage::setIsDeveloperMode(true);
umask(0);
Mage::app();
Mage::app()->setCurrentStore(Mage::getModel('core/store')->load(Mage_Core_Model_App::ADMIN_STORE_ID));

$setup = new Mage_Eav_Model_Entity_Setup('core_setup');

    try {
        $custAttr = 'user_name';  // here enter your attribute name which you want to remove

        $setup->removeAttribute('customer', $custAttr);
        echo $custAttr." attribute is removed";
    }
        catch (Mage_Core_Exception $e) {
        $this->_fault('data_invalid', $e->getMessage());
    }

?>

please help me.


texts: What are the magento 2 events will triggers at simple product creation

texts:
Can you please list the events which are triggered at the time of simple product creation in magento2.

Recently I would learn about simple product creation and which are the database tables gets affected at the time of simple product creation.

So, now I just started to search for the simple product creation event, where those events are located and the purpose of those events.

Just gone through most of the links for finding a solution to my question.  But for my bad luck, I didn't get the exact answer.

can anyone help me to find the answer?

Thanks in advance.


texts:
I was considering building an auto-login feature for an extension I'm working on, where a customer who clicks a link in an email will be automatically logged in to their account.

This would be really helpful especially when sending to older customers because there's a high change they would need to hit the forgot password in order to get logged in and make a purchase.

But on the other hand, it would open up some vulnerabilities that I'm not too excited about.  If a customer forwards the email to their friend and their friend clicks the links, they'll also be logged in as their friend.

Granted you could try to educate your customers to not forward those emails, but that might be an uphill battle.  The idea that forwarding a marketing email to a friend would allow them to login to your account unauthorized is not something people will get used to quickly.

Thoughts?

UPDATE: Just noticed that Quora does an autologin from it's comment notification emails.


texts:
I am trying to get a No-index,follow on all List Mode pages.
To index all grid pages is just fine, but i do not want all duplicated list pages to be in the search result. been playing around but not find a solution yet.


texts: Spam in product reviews - always on same product

texts:
We regulary receive spam reviews in Magento, but manually approve/decline reviews so it does not make any harm - other than a few seconds extra work.

But I wonder.. all spam posts are always (without exceptions) related to the same product. I tried to change URL to this product a while ago, but no difference. I know I can delete and create it as a new item.. but I'm a bit querious on why this product only is affected.  Can anyone explain why?


texts: Uncaught DOMException: Blocked a Frame with origin from accessing a cross origin-frame

texts:
I have a Magento 1.9 site that uses TinyMCE. Everything worked fine until I added a cdn. The script wouldn't load because it was on a different domain. I went ahead and added a subdomain but it still doesn't work. When I started troubleshooting I came across this http://archive.tinymce.com/wiki.php/TinyMCE3x:How-to_load_TinyMCE_crossdomain

I changed the header of the script to-

//Uncomment and change this document.domain value if you are loading the script cross subdomains
  document.domain = "assets.example.com";

At the end of the script I also added (in bold)-

**document.domain = 'assets.example.com';**tinyMCEPopup.init();

Still doesn't work. The errors I am getting are-

Uncaught DOMException: Blocked a frame with origin "https://assets.example.com" from accessing a cross-origin frame.
at Object.init (https://assets.example.com/js/tiny_mce/tiny_mce_popup.js:5:106)
at https://assets.example.com/js/tiny_mce/tiny_mce_popup.js:5:4810
init @ VM1187 tiny_mce_popup.js:5
(anonymous) @ VM1187 tiny_mce_popup.js:5
mctabs.js:13 Uncaught TypeError: Cannot read property 'windowManager' of undefined
at new MCTabs (mctabs.js:13)
at mctabs.js:119
MCTabs @ mctabs.js:13
(anonymous) @ mctabs.js:119
form_utils.js:11 Uncaught TypeError: Cannot read property 'baseURI' of undefined
at form_utils.js:11
(anonymous) @ form_utils.js:11
VM1187 tiny_mce_popup.js:5
Uncaught TypeError: Cannot read property 'plugin_url' of undefined
at Object.getWindowArg (VM1187 tiny_mce_popup.js:5)
at Object.requireLangPack (VM1187 tiny_mce_popup.js:5)
at link.js:1


texts:
I have a plugin with constructor

<?php
namespace Vendor\Contact\Plugin\Controller\Index;

use \Zend_Validate;
use Magento\Contact\Controller\Index\Post;
use Magento\Framework\App\Request\Http;
use Vendor\Contact\Model\QuestionFactory;

/**
 * Class BeforeQuestionSave
 * @package Vendor\Contact\Plugin\Controller\Index
 */
class BeforeQuestionSave
{
    /**
     * @var Http
     */
    private $getRequest;

    /**
     * @var QuestionFactory
     */
    private $questionFactory;

    /**
     * @var Zend_Validate
     */
    private $zendValidate;

    private $validationNotEmpty;
    /**
     * BeforeQuestionSave constructor.
     * @param Http $request
     * @param QuestionFactory $questionFactory
     * @param Zend_Validate $zenValidate
     */
    public function __construct(
        Http $request,
        QuestionFactory $questionFactory,
        Zend_Validate $zenValidate,
        Zend_Validate_NotEmpty $notEmpty
    ) {
        $this->questionFactory = $questionFactory;
        $this->getRequest = $request;
        $this->zendValidate = $zenValidate;
        $this->validationNotEmpty = $notEmpty;
    }

    /**
     * Before execute
     *
     * @param Post $subject
     */
    public function beforeExecute(Post $subject)
    {
        $data = $this->getRequest->getPostValue();
        if ($this->validatePostData($data)) {
            $question = $this->questionFactory->create();
            $question->setData($data)
                ->setPhone($data['telephone'])
                ->setContent($data['comment'])
                ->save();
        }
    }

    /**
     * Validation method
     *
     * @param array $data
     * @param Zend_Validate $object
     *
     * @return bool
     */
    public function validatePostData($data)
    {
        $validation = $this->zendValidate;
        $validate = false;
        $validation->addValidator($this->validationNotEmpty);

        if ($validation->isValid(trim($data['name'])) && $validation->isValid(trim($data['telephone']))) {
            $validation->addValidator(new \Zend_Validate_EmailAddress());

            if ($validation->isValid(trim($data['email']))) {
                $validate = true;
            }
        }

        return $validate;
    }
}

When i run it i get exception   Type Error occurred when creating object:

  Vendor\Contact\Plugin\Controller\Index\BeforeQuestionSave

I can see below error in my error log:

 [2019-08-26 13:37:57] main.CRITICAL: Type Error occurred when creating object: Vendor\Contact\Plugin\Controller\Index\BeforeQuestionSave, Too few arguments to function Vendor\Contact\Plugin\Controller\Index\BeforeQuestionSave::__construct(), 3 passed in /var/www/html/magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 116 and exactly 4 expected [] []
[2019-08-26 13:37:57] main.ERROR: Type Error occurred when creating object: Vendor\Contact\Plugin\Controller\Index\BeforeQuestionSave [] []

How i can pass 4-th argument?
I try replace new \Zend_Validation_NotEmpty && Email to DI in constuctor


texts: Limit template to only one page in adminhtml

texts:
For now I have directly edited this file

\vendor\magento\module-backend\view\adminhtml\templates\widget\grid\extended.phtml

and I have added a button as you can see from the photo below

But this template file edits all the pages in Reports>Sales and I would like to have this button being visible only for Reports>Sales>>Orders
How could I limit the button only for Orders?


texts: Magento 2 Show Custom Option on Custom Page

texts:
How to get Product custom option and show into custom page.this is a product custom option.

Now when add to cart  this product then it's show like this

When click on add to list data store into table with custom option. I want to show custom option like cart page showing.Problem is showing custom options into custom page.

Update I get this type of array when add to list and I store option into database using jsonencode().

Array
(
    [listid] => 18
    [prdid] => 4
    [product] => 4
    [selected_configurable_option] =>
    [related_product] =>
    [item] => 4
    [form_key] => h6EN0ffZOHD3Ta5K
    [options] => Array
        (
            [3] => 7
            [4] => Custom Val
            [5] => Array
                (
                    [0] => 8
                    [1] => 9
                )

            [6] => 10
            [7] => Area Text
            [8] => Array
                (
                    [0] => 12
                    [1] => 13
                )

        )

    [options_10_file_action] => save_new
    [qty] => 1
)

Store into table like this

{"options":{"3":"7","4":"Custom Val","5":["8","9"],"6":"10","7":"Area Text","8":["12","13"]}}

How to do it ?
Please Help me.


texts: My website not showing products on front page

texts:
Any help will be highly appreciated. My website https://muzikhausberlin.de is not showing products on the front page, however on other pages products working fine but I can't see any images in a block and on front page content section.

Moreover there is no widget on my website.

Thank advance for support.


texts: How to get the breadcrumbs in my custom module phtml file?

texts:
I want to display the category breadcrumb in my custom modules product details page phtml file as:

Home/My Module/Category/Product name

In my

\app\design\frontend\base\default\template\magenshop\recipe\view.phtml

Is this the right way of adding in phtml file?

<?php  $breadcrumbs = $this->getLayout()->getBlock('breadcrumbs');
          $breadcrumbs->addCrumb('home', array(
              'label'=>Mage::helper('catalog')->__('Home'),
              'title'=>Mage::helper('catalog')->__('Go to Home Page'),
              'link'=>Mage::getBaseUrl()
          ));
           $breadcrumbs->addCrumb('recipes', array(
              'label'=>Mage::helper('catalog')->__('Recipes'),
              'title'=>Mage::helper('catalog')->__('Go to Recipes Page'),
              'link'=> Mage::getBaseUrl().'recipes/' //  Module Url
          ));
          $breadcrumbs->addCrumb('category', array(
              'label'=>Mage::helper('catalog')->__($cat->getTitle()),
              'title'=>Mage::helper('catalog')->__($cat->getTitle()),
              'link'=> $CategoryUrl //  Category Url
          ));
    echo $this->getLayout()->getBlock('breadcrumbs')->toHtml();
  ?>

I also added in my modules layout file as:

\app\design\frontend\base\default\layout\magenshop\recipe.xml

<reference name="root">
        <action method="unsetChild"><alias>breadcrumbs</alias></action>
        <block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs">
            <action method="addCrumb">
                <crumbName>Home</crumbName>
                <crumbInfo>Home<title>Home</title><link>/</link></crumbInfo>
            </action>
            <action method="addCrumb">
                <crumbName>Parent Page</crumbName>
                <crumbInfo>Parent Page<title>Parent Page</title><link>/Parent Page link</link></crumbInfo>
            </action>
            <action method="addCrumb">
                <crumbName>Current Page</crumbName>
                <crumbInfo>Current Page<title>Current Page</title></crumbInfo>
            </action>
        </block>
    </reference>

But there is no output of any crumbs


texts: How to Catalog Catogory Default position in magento 2?

texts: I want to arrange home at first position and about us last one and another two categories in middle


texts: Is safe supplier bank details(bank name,account number) stored in custom table?

texts:
I want to store supplier bank details in my custom table for transfer amount to their accounts.Is it safe store supplier bank details in database table ?
Is it need encryption for bank details ? if need encryption which encryption and all bank details data need encryption ? What I do in this situation ? please hint me please


texts: When ViewModel class need to create in Magento2?

texts:
I have followed Magento_Catalog Module and I have found

ViewModel folder there.

Can anyone please explain when we need to create ViewModel classes when we creating our custom module?


texts: Magento 1.9.3.2 Transactional Email style

texts:
I have updated Magento from 1.9.3.2 to 1.9.3.6. But after updating to this latest version, Magento is ignoring email-inline.css file for Transactional email. Because all the sales emails templates were working fine before updating but now system is not applying emial-online.css styles.
But when I write css directly in template in Magento Admin panel, than system apply those css styles.

I have already checked my settings in Admin -> configuration -> General  -> Design -> Transactional Email  (Non-inline CSS File) field.


texts: missing footer on category pages - Magento 1.9

texts:
I cannot workout why but i seem to be missing the footer section on my store when viewing category pages.

http://dev.colourcalendars.com/a4-wall-calendars.html

In all other sections this seems to display perfectly but for some reason is missing on the category sections - is there something i am missing with this?

Any help would be appreciated because i cannot work this out??


texts:
We have a magento webshop. Sometimes another shop orders an item and wants us to deliver it to the client. The client orders from the partner's website (not magento - doesn't have a connector to our site), and then the partner manually orders the products on our site under the client's name and address, using his discount code.

When we print an invoice for such an order, our name is displayed on the invoice, plus the discount we give to this partner. One option is to create another shop in a subdomain with its own invoice header etc. This leaves the problem of the discount still unsolved, although I could probably make it so that invoices for this shop don't display discounts.

Looking for dropshipping options for Magento I find modules that work the other way around, for clients that order products on our website and we let it ship by another partner.

I would like to know if there are better solutions. Now we have only one dropshipping partner, but we want to promote this option and use it more often. So is there a more easy way to handle it?


texts:
I have a magic zoom plus on my site on product detail page, I need to decrease the size of lens irrespective of image size.

I know lens become bigger and smaller based on zoomed image size but is there any way I can control this?


texts: How to add product specification table in long description field in magento 1.9

texts:
I am working on magento project which requires product specifications in table format and some of the fields on that table dynamically change values based on the selected attributes.
I tried making changes in app\design\frontend\base\default\template\catalog/product/view/description.phtml

By adding blocks and widgets but they only show values in static format. I want the cells to show information in dynamic way.

I followed some blogs and they say it can be possible by using Ajax and JavaScript, but I don't understand how to use this to find selectors of those attributes. I already enabled debug hints from the admin panel but am still unable to find selectors responsible for those attributes.

https://www.malabargoldanddiamonds.com/malabar-settings/mine-solitaire-yellow-gold-ring-mount-r76119y.html

I saw a website doing the same thing, and it is also built on Magento 1.9. For this site, the values are changing in the below table as per the size of the ring selected and diamond quality selected..


texts: Cache breaks my check for detecting if a customer is logged in

texts:
When I turned off cache (bin/magento cache:disable) the below code works otherwise it's not working.

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$customerSession = $objectManager->get('Magento\Customer\Model\Session');

if($customerSession->isLoggedIn()) {
    echo "logged in";
}else{
    echo "no logged";
}


texts: Running a script inside a docker container using shell script from host

texts:
I am new to Docker technology,I am trying to create a shell script on my host to clear caches and to deploy my static content in Magento 2 inside my apach containe.
to access to my apach container i use this command :

docker-compose exec --user www-data apache bash

and i created my script shell in the my project root on my host.
my question is how can i run my shell script outside my apache container to execute this command:

bin/magento setup:static-content:deploy

Thanks in advance.


texts: how do I go from the back office to see the front end changes of my store? no link to view store front?

texts:
I'm a total newbie and can't see how to move out of the back office to see the front end of my store?
I expected a link (as in prestashop - view my store) but its not there with Magento?

Help anyone
Thanks


texts: catalog_category_product_index_store1 has stopped updating on reindex

texts:
I am currently having issues with making products display when adding them to new categories.

The table catalog_category_product_index_store1 is no longer adding new records when reindexing

Has anyone faced this issue before and know of a fix?


texts:
How to export my custom grid data's in xls format in Magento Admin panel grid.

In default we having the csv and xml format.

Anyone help me on it.


texts: Magento 2 Add input fields to Product Admin

texts:
I have added various input fields to a tab in the edit product page in the admin area, e.g.

<input type="text" name="my_field"/>

I have an observer and I can get the post fields.

$post = $this->_request->getPostValue();

I can see all the regular magento fields, but I cannot see the fields I added myself.
How do get my custom fields to post data?


texts: Magento 2 - Reauth/Revalidate the Customer Password after placing the order

texts:
Revalidate the logged-in customer's password after placing the order, once the password is correct, order status is changed to "New Status" till that it will in "Pending" status on Admin.

Is there any possible way to validate the customer's password after placing an order?


texts: Arabic store price format replace , with . magento 1.9x

texts:
How can I change the format of the price in the frontend for the Arabic store?

Eg:د.إ. 1٬486٫00 to د.إ. 1٬486.00

instead of, I need to change with.


texts: How do I add the product ID/SKU to my search results?

texts:
I want to show the SKU code on search result listing page.
Like this
https://support.3dcart.com/knowledgebase/article/View/269/6/how-do-i-add-the-product-idsku-to-my-search-results

Thanks everyone.


texts:
Is there anyway to change the default sitemap url from:

http://mysite.com/catalog/seo_sitemap/category

to just:

http://mysite.com/sitemap


texts: Geotargeting: Multiple subdirectories for same language

texts:
Is it reasonable to create multiple stores i.e.
[site].com/uk/
[site].com/scot/
[site].com/ie/

For the purpose of taking advantage of webmaster tools geotargeting features to rank better in those countries?

Further - Is it a good idea to create others for countries with high english speaking populations without the intention of translating product descriptions? i.e.
[site].com/no/
[site].com/nl/


texts: Having problem with multi languages store in magento2

texts:
My problem is that I have three store views and I set three languages view from admin. In frontend when I click on second language it work than i click on third language url it give error and not redirect.

Url: https://telecarsi.de

Please click on language pop twice then it give error i want to switch language.


texts: How can I extend the CMS Page When using Magento Enterprise

texts:
I am using Magento enterprise and want to add an additional field to the CMS page form in the backend.

Is there anything special to take care of, to not break the CMS versioning feature?


texts: How do I keep Magento from incrementing the number appended to my URL?

texts:
I've recently taken over a Magento project and taking a look at Webmaster Tools, it seems my product URLs keep changing.

See:

Product One

/product-one-7139.html
/product-one-7147.html
/product-one-7169.html
/product-one-7252.html
/product-one-7266.html
/product-one-7382.html
/product-one-7387.html
/product-one-7397.html
/product-one-7427.html
/product-one-7445.html

Looking at Magento's URL Rewrite Management tool I have 41 pages (817 results) for "product one" URLs like this.

This can't be good for Google to be forever learning new 301s. Has anyone else experienced this?


texts: Call to a member function getMethod() on a non-object in /var/www/html/app/code/local/Openpay/Banks/Model/Observer.php on line 16

texts:
I have implemented a third party api and I am getting bellow error:

  Fatal error: Call to a member function getMethod() on a non-object in
  /var/www/html/app/code/local/Openpay/Banks/Model/Observer.php on line
  14

at line 14 I have below code:

if(Mage::getConfig()->getModuleConfig('Openpay_Banks')->is('active', 'true')){
    $order_ids_list = $order_ids->getOrderIds();
    $order_id  = $order_ids_list[0];
    $order = Mage::getModel('sales/order')->load($order_id);

    $code = Mage::getModel('Openpay_Banks_Model_Method_Banks')->getCode();

    if($order->getPayment()->getMethod() == $code){
        $args = array(
            'order' => $order->getIncrementId(),
            'id' => $order->getPayment()->getOpenpayPaymentId(),
        );

        $this->_redirect('print', 'payments', $code, $args);
    }

what I can do to fix this error?


texts:
The company I work for sales custom made signs so a large majority of our Magento orders are custom items.

Before an order is created, there is a mockup design of the sign made and that image is saved to the order.  Now I have been tasked with creating a way for the Finished product image to be added to the order.

So if an order is made and then 2 weeks later the sign is built, we need to then be able to attach some product images to that order.  Si when we look up an order in Magento, we would be able to see the images alongside any existing images for that order.

What is nice is I have the freedom to do this outside of an Extension if needed.

I would appreciate any help in the right direction on how to attach an image to an existing order? (Not a product)


texts: Point the canonical tag for associated products to the parent product

texts:
We have a store with around 80000tsd Products. All of them are linked to about 2tsd parent products. I was wondering, if it would be a good idea to set the canonical tag of the simple products to their respective parent product. We are using Simple Configurable Products by the way.

Has anyone any experience with that? Especially concerning Google Rankings!

For the technical part I would have used something like

Mage::getModel('catalog/product_type_configurable')
    ->getParentIdsByChild($_product->getId());

to get the ID and then load the product to get the URL. I could imagine there could be a more efficient way? Any thoughts?


texts: Loading variable amount of products based on multiple attributes

texts:
On a custom page I receive an array of data from another db. This has three or less product attributes set.

  $products =
  [0] => Array
    (
        [field_1] => dsvx
        [field_2] =>
        [field_3] =>
    )

[1] => Array
    (
        [field_1] => dssdf
        [field_2] =>
        [field_3] =>
    )

[2] => Array
    (
        [field_1] => dsfeebe
        [field_2] => GBURG
        [field_3] => M
    )

[3] => Array
    (
        [field_1] => nionj
        [field_2] => blue
        [field_3] => S
    )

Each part of the above array may or may not represent a product in my magento db. In cases where it does represent a product in my magento db it is possible that not all of the fields are applicable. For example in part [2] of the array all three fields are populated. But it could be a case that I only have a product in my magento db that matches field_1. This would be ok as long as the corresponding field_2 and field_3 in my magento db are null.

The other point to note is that I only want to load one magento product per product in the array I'm checking against. This obviously needs to be the most closely matched product.

Due to the nature of this I'm inclined to think that using the collection method for getting all matching products may not be suitable. (I'm totally open to being corrected on this).

The method I was planning to choose would look something like the following

  foreach ($products as $key => $value) {
        if( product exists with matching field1, field2, field3){
             record id of magento product with attribute matching field1, field2 and field3
        }elseif(product exists with matching field1, field2,){
             record id of magento product with attribute matching field1 and field2
        }else{
             record id of magento product with attribute matching field1
        }

    }

Using that method and building on a call like Mage::getModel('catalog/product')->loadByAttribute('field1', 'somevalue'); how would it look like syntax wise? Can i just put an array in so it would look like this Mage::getModel('catalog/product')->loadByAttribute(array('field1'= 'somevalue','field2'='anotherval','field3'=>'morevals'));

Alternatively can this be done using a collection?


texts:
I'm working on the Checkout page and I noticed that, as a logged-in customer, Magento 2 will remember the Shipping Method you selected the last time you placed an order (for example: "Flat Rate").

How can I force it to forget it? I tried removing cookies, local storage, and even with Incognito mode. Is it storing the data somewhere on the database?

Thanks in advance


texts: How to load all products with certain type - e.g. all configurable products?

texts:
How can I get a collection of all products from a specific type example given: "configurable" ?

I want to show the name of all products of type configurable for example.


texts: Magento2 - Multistore/domain export one website import in fresh install

texts:
I was wondering if it is possible to export a whole website (Including blocks, widgets, products, etc. which are enabled for that specific website)

Lets say you have a multistore/domain setup which contains website A and website B.

Website A belongs to company X and website B belongs to company Y.

Company X and company Y broke up with each other, and they want to split the multi store in 2 seperate installs. But they want to keep their blocks, widgets, products, etc.

Is this possible?


texts: Magento2-Fotoroma Showing All images on Desktop Version

texts:
I want all the products are listed on product details page.
what I want is "unslick" feature as slick slider indeed.
How can I passivate slider greater than 1024px breakpoint?
Like this;
Desktop version;

Mobile version;


texts:
phtml

<form id="Upload" action="<?php echo Mage::getUrl('followup/index/follow') ?>" method="post"
      enctype="multipart/form-data">
    <input type="hidden" name="form_key" value="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>"/>

<input id="customer_name" type="hidden" name="customer_name" value="<?php echo $customer->getName(); ?>">

<input id="customer_email" type="hidden" name="customer_email" value="<?php echo $customer->getEmail(); ?>">

<input id="seller_id" type="hidden" name="seller_id" value="<?php echo $id; ?>">

<input id="seller_email" type="hidden" name="seller_email" value="<?php echo $customerData->getEmail(); ?>">

<input id="button" type="submit" name="submit" value="Follow me!">

</form>

controller

public function followAction(){
    $cus_name = ''.$this->getRequest()->getPost('customer_name');
    $cus_email = ''.$this->getRequest()->getPost('customer_email');
    $seller_id = ''.$this->getRequest()->getPost('seller_id');
    $seller_email = ''.$this->getRequest()->getPost('seller_email');

    $collection = Mage::getModel('followup/followup');
    $collection ->setData('customer_name',$cus_name);
    $collection ->setData('customer_email',$cus_email);
    $collection ->setData('seller_id',$seller_id);
    $collection ->setData('seller_email',$seller_email);
    $collection->save();
}

It's insert database successfully but I want to delete if already exist ? How to write controller on that?


texts: How to make inline edit in admin order grid row?

texts:
Can any one please let me know how to override admin sales order grid ui component to make it inline edittable? I have added custom column in the sales order grid and want to make it edittable. Please explain with example.
There are multiple examples to making any custom grid inline editable. I need help for sales order grid.


texts: Magento 2 (2.2) add custom tab for simple product only in admin

texts:
I want to ceate new configuration tab under product edit form admin for simple product only and save data to custom table.

I am using following scenario:

1- My/Module/view/adminhtml/ui_component/product_form.xml

<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
 * Copyright © 2016 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="my_fieldset" class="My\Module\Ui\Component\Form\Fieldset">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="label" xsi:type="string" translate="true">More Product Links</item>
                <item name="sortOrder" xsi:type="number">1000</item>
            </item>
        </argument>
    </fieldset>
</form>

2- My\Module\Ui\Component\Form\Fieldset.php

<?php
namespace My\Module\Ui\Component\Form;

use Magento\Framework\View\Element\UiComponent\ContextInterface;
use Magento\Framework\View\Element\UiComponentInterface;
use Magento\Ui\Component\Form\FieldFactory;
use Magento\Ui\Component\Form\Fieldset as BaseFieldset;

class Fieldset extends BaseFieldset
{
    /**
     * @var FieldFactory
     */
    private $fieldFactory;

    public function __construct(
        ContextInterface $context,
        array $components = [],
        array $data = [],
        FieldFactory $fieldFactory)
    {
        parent::__construct($context, $components, $data);
        $this->fieldFactory = $fieldFactory;
    }

    /**
     * Get components
     *
     * @return UiComponentInterface[]
     */
    public function getChildComponents()
    {
        $fields = [
            [
                'label' => __('Field Label From Code'),
                'value' => __('Field Value From Code'),
                'formElement' => 'input',
            ],
            [
                'label' => __('Another Field Label From Code'),
                'value' => __('Another Field Value From Code'),
                'formElement' => 'input',
            ],
            [
                'label' => __('Yet Another Field Label From Code'),
                'value' => __('Yet Another Field Value From Code'),
                'formElement' => 'input',
            ]
        ];

        foreach ($fields as $k => $fieldConfig) {
            $fieldInstance = $this->fieldFactory->create();
            $name = 'my_dynamic_field_' . $k;

            $fieldInstance->setData(
                [
                    'config' => $fieldConfig,
                    'name' => $name
                ]
            );

            $fieldInstance->prepare();
            $this->addComponent($name, $fieldInstance);
        }

        return parent::getChildComponents();
    }
}

This is showing on every product edit section but I want to show only for simple product.

Any help would be appreciated.


texts:
I have inherited a Magento CE 1.4 shop that obviously needs upgrading. Preferrably I'd want to migrate straight to Magento CE 2 to be the most future proof. I am aware that this is not supported by official guide, and I'll most likely need to do most of the stuff manually.

The shop has around 4,000 SKUs, so it's not huge, but it's not small either, so I'd love some guidance on how to keep the amount of pain as small as possible - being fully aware that it will likely be painful nonetheless...

The whole thing gets further complicated by the fact that the current shop is in a shared hosting environment, so anything that needs SSH access to the current shop is out of the question.

The most important factors for me are:

1) Products and product attributes

I'd really need these transferred. I know I can do an export of products to CSV from the Magento 1.4 shop.

Is the CSV produced compatible with the 2.x importer?
Is there a way to get a similar export/import for attributes?

2) Customers

Basically the same as above. Can the exported data be imported to a 2.x shop?

I'm alright if I need to set up categories and the CMS completely manually, and need to do any custom features manually as well.

Is there any other guidance you can give me to avoid the worst headaches and nervous break downs during this migration?


texts:
Since a few days, our store is getting a lot of new fake accounts registration from russian bots with first and last name that looks like :

  Денис, сегодня не вторник февральский Киберпонедельник и мы раздаем тройной кэшбэк: https://google.com/#q=t0p0%70rO%73&b%74%6E%49=RU28507 - получение только в течение 24 часов Для получения информации перейдите по ссылке выше

I've tried to update the field limitations rules as indicated in this post (Prevent Spam Account Registration) but nothing.

Appreciate your help, thanks.
P.S : Captcha is enabled for user creation.

Edit: I was finally able to solve this issue by setting the "displaying mode" for the captcha  to "always".


texts: Magento 2 remove Meta Tag robots From whole Website

texts:
Doe anyone know where and how to remove <meta name="robots" content="INDEX,FOLLOW"/>  tag for good?

Thanks!


texts: How can i override abstract class protected function

texts:
I want to override abstract class Magento\Sales\Controller\Adminhtml\Order\Create of the below method
protected function _processActionData($action = null){

 }

I have tried using preference but it is not working.
Can anybody help me with this?


texts:
I am trying to get up-sell product in Magento 2 via objectManager. Current product id and name is returning well but up-sell product return empty.

<?php
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product
    echo $product->getId();
    echo $product->getName();
    //echo $currentProduct->getSku();
if ($currentProduct = $product->getCurrentProduct()) {
    $upSellProducts = $currentProduct->getUpSellProducts();
    print_r($upSellProducts);

    if (!empty($upSellProducts)) {
        echo '
UpSell Products
';
        foreach ($upSellProducts as $upSellProduct) {
            echo $upSellProduct->getSku() . '
';
        }
    }
}
?>


texts: Call new block in template with event and observer magento 1.9.x

texts:
I need to create a new block in the sucess page when a customer wins a gift (all 10 commands) how do I do that? Can you help me please

This is my observer

public function countOrder(Varien_Event_Observer $observer) {

$resource = Mage::getSingleton('core/resource');
$writeConnection = $resource->getConnection('core_write');

$action = $observer->getEvent()->getAction();

$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
$_orders = Mage::getModel('sales/order')->getCollection()->addFieldToFilter('customer_id',$order->getCustomerId())
         ->addAttributeToFilter('created_at', array('from'=>strtotime('-20 day', time()), 'to'=>time(),'datetime' => true));
$_orderCnt = $_orders->count();

Mage::log( $_orderCnt, null, 'count.log');

  if( $_orderCnt % 10 === 0 ) {

          Mage::log( $_orderCnt . ' ', null, 'win.log');

        // i want add new block or create a new template success for the winner !!!

  }
}

this is my config.xml

 <events>
        <checkout_onepage_controller_success_action>
            <observers>
                <mycustom_module>
                    <type>singleton</type>
                    <class>mycustom_module/observer</class>
                    <method>countOrder</method>
                </mycustom_module>
            </observers>
        </checkout_onepage_controller_success_action>
        <core_block_abstract_to_html_before>
            <observers>
                <mycustom_module>
                    <type>singleton</type>
                    <class>mycustom_module/observer</class>
                    <method>insertBlock</method>
                </mycustom_module>
            </observers>
        </core_block_abstract_to_html_before>
    </events>

How i can add new block or create a new template success for the winner ? i don't understand how i can do this ? Can you help me please ?


texts: SearchCriteria Logical OR and AND search

texts:
I am trying to get a search criteria to become the following SQL:

WHERE (a = 1 AND b = 2) OR (c = 3)

Magento2 Documentation only has the example where AND and OR are reversed. Is this even possible? It doesn't seem like it is.


texts: Add Custom Fieldset Without making a Core module Rewrite

texts:
I am wondering, is there any way to add a custom fieldset to an admin form, without overwriting Form container class of that admin-form.

I will explain it little bit. Suppose we need to add a new fieldset in CMS_Block. We can achieve this by rewrite _preapreForm() method of class Mage_Adminhtml_Block_Cms_Block_Edit_Form. Here we need to do somewhat this in order to achieve our goal

class Namespace_Modulename_Block_Adminhtml_Cms_Block_Edit_Form extends Mage_Adminhtml_Block_Cms_Block_Edit_Form{

    protected function _prepareForm()
    {
        parent::_prepareForm();

        /*
           add new fieldset and fields here
        */
    }
}

However I don't like to do rewrite of a core class (Since Its not a good practice). Is there any other approach exist to achieve the same result. I just want to add a new field sets with a custom module on an admin form with two conditions

Without touching core files
Without doing rewrite

Eagerly waiting for your responses.


texts:
I'm playing overriding the blocks in magento 2, extended block constructor is calling but inside method is not working?

my code is

di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Magento\Customer\Block\Account\Dashboard\Info" type="Learning\Customers\Block\Info" />
</config>

Info.php

  <?php

namespace Learning\Customers\Block;

use Magento\Framework\View\Element\Template;

class Info extends \Magento\Customer\Block\Account\Dashboard\Info
{

    public function __construct(
        \Magento\Framework\View\Element\Template\Context $context,
        \Magento\Customer\Helper\Session\CurrentCustomer $currentCustomer,
        \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory,
        \Magento\Customer\Helper\View $helperView,
        array $data = []
    ) {

        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/Info.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info($this->getName());

        parent::__construct($context,$currentCustomer,$subscriberFactory,$helperView, $data);
    }

    public function getName()
    {
        return 'Magento 2';
    }

}

Any suggestions?

Thanks.


texts: In magento 2, zip code text box to search the store available or not

texts:
I am new to Magento.

I want a text box where i can type the zip code and if the store available in that location then i need to show the products of that particular store otherwise we need to show that "the store is not available in particular location".

The following is the example site. i want it as it is. this site prompts for users zip location .after it will display stores of that particular.

Click on this link to see the working example

how do i do this . Do i need to install a module ?


texts: Currently my site is using porto 3.1.7 theme. I want to upgrade the theme to 3.2.0. My version is Magento 2.3.0. How can I upgrade the theme. Is there something I need to take care of ? Will it affect my custom code ?


texts: Magento 2.2.3 Vat-Id Field not showing Shipping or Billing Address

texts: I have enabled the Show Vat number option in the frontend, but the Vat-Id field is only displayed on the sign-up form. I can not add the VAT number on the shipping or billing address forms on the checkout page.


texts: Magento 1.9 custom module for managing admin users in different role

texts:
Am working on a custom module for managing admin users in a custom role. Just finished the grid section. I need to edit the listed users, also a add form.

I just tried by overriding the

  'Mage/Adminhtml/controllers/Permissions/UserController.php'

but getting the following error.

  Fatal error: Call to a member function setData() on boolean in
  C:\xampp56\htdocs\magento\app\code\core\Mage\Adminhtml\controllers\Permissions\UserController.php
  on line 94

Any help will be appreciated. Thanks in advance.


texts: Magento 1.9 change customize the search result based on custom attribute value

texts:
I have a magento 1.9 and would like to customize the search result in such way the it will show result based on a custom attribute I have in the system. we are selling fabrics and each fabric has a custom attribute called "Pattern" ( we have more custom attributes) . this custom attribute has the values "Solid,Paisley,Patchwork" . I would like to modify search result to show "Solid" first when people search .

I appreciate your comment .


texts: Adding JQuery file in XML only if not yet added

texts:
I am new to Magento Extension developer and i am creating an Image Slider. I am having problem on including JS file via XML file. How to check and include our JQuery file so that my extension run smoothly even if the JQuery.js already included by another extension.
Thank in Advance


texts:
I've experienced this issue with Magento for a very long time.

When applying an adjustment fee to a credit memo, I have to do the following

Configure Qty to Refund accordingly
Fill in the Adjustment Fee
Click Update Qtys (at which point the Grand total is updated)
Fill in the Adjustment Fee again (even though the Grand total is correct)
Click Refund

My question is as follows:

If I don't fill in the Adjustment Fee the second time, it isn't applied (the Adjustment fee value needs to be in the textfield when I click Refund, otherwise even though it is reflected in the grand total, it isn't applied when the credit memo is created & then the grand total is different on the created credit memo.

Why is this the case?


texts: Why "POST /rest/V1/order/:orderID/ship" doesn't work in Magento 2.1.1 CE?

texts:
Why does "POST /rest/V1/order/{orderId}/ship" not work in Magento 2.1.1 CE?

Returns error : "Request does not match any route error" in Ship Method.


texts: How to run Magento 2.3 on several domain aliases, but using only one website (and one storeview)

texts:
I need to create many different magento 2.3 shops as subdomains of the main shop www.domain.com; eg shop1.domain.com, shop2.domain.com, shop3.domain.com, shop3.domain.com
All those subshops will share the exact same content, products and storeviews (content in different languages using subdirectories /en /fr /de etc) of the main domain and my goal is to not create a different magento website or magento storeview for each of such subdomains. I'll customize just some graphic of the subdomains by loading a different theme/css based on the HTTP HOST env variable.
Can you tell me how to achieve this?
I've now configured nginx so that all the subdomains are mapped to the same document root, but when now I load a.domain.com I get automatically redirected to www.domain.com
In my index.php I've added the lines below before ($bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);):
switch($_SERVER['HTTP_HOST']) {
    case 'shop1.domain.com':
         $params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = '<default_storeview_code>';
         $params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'store';
    break;

}

I want that if I type shop1.domain.com in the browser address bar I'm not redirected to the main url set for the storeview www.domain.com (this is my current problem).
Thank you!


texts:
Magento 2.1.4 : Disabled flat rate via store > configuration > sales > shipping method like this:

I have already deleted the cache, upgrade, static content deploy but it keeps showing the flat rate at checkout:

i checked the core config data, turns out there was flat rate that was still active:

but when i set the active value to zero, and cleared cache and etc, when i go to /checkout and fill address and post code ,  its not triggered to refresh the shipping method, so it said there is no shipping method available


texts: Force all Caps/Uppercase on Magento2 Registration Form

texts: I am looking for the proper way to force the Magento 2.3 registration form to submit all registrations in all caps. I have tried the text-transform:uppercase with no luck. I am thinking that Magento does not keep this because of the post method. Is there a proper way to get this done using Javascript? Any guidance would be much appreciated.


texts: Table flaterate depends on the city with weight

texts:
Magento2
I want to add tablerate depends on the city with the weight of product instead of Region/State
Please advice


texts: Get Store Number in Module Magento 2 Compilation Error

texts:
I am trying to get the store number using a module the correct way and am having a bit of difficulty. I have used the below code which works however when trying to compile i recieve an error. My code is currently as below:

namespace Vendor\Module\Block;
class Contact extends \Magento\Framework\View\Element\Template
{
protected $_storeInfo;
protected $_storeManagerInterface;

public function __construct(
    \Magento\Framework\View\Element\Template\Context $context,
    \Magento\Store\Model\Information $storeInfo,
    \Magento\Store\Model\StoreManagerInterface $storeManagerInterface,
    array $data = []
)
{
    parent::__construct($context, $data);
    $this->_storeInfo = $storeInfo;
    $this->_storeManagerInterface = $storeManagerInterface;
}
public function getPhoneNumber()
{
    return $this->_storeInfo->getStoreInformationObject($this->_storeManagerInterface->getStore(null))->getPhone();
}
}

This appears to work fine and number is shown on front-end as expected. However upon running 'bin/magento setup:di:compile' the following errors are shown and compilation fails.

Incorrect dependency in class Vendor\Module\Block\Storenumber
\Magento\Store\Model\StoreManagerInterface already exists in context object

I can see that the storeManager interface is already called within \Magento\Framework\View\Element\Template however removing this from construct also does not work. How do i correctly call the store number?


texts: displaying data from two tables in one grid

texts:
I have a grid for my admin module and it works fine, but I now would like to add more data onto that grid, but the additional data is held in a second table in my database.

To display this additional data I have tried

protected function _prepareCollection()
{
    $collection = Mage::getModel('modulename/modelname')->getCollection();
    $collection->join(array('table2' => 'table1'), 'table1_id = table2_id', 'unsubscribed');//additional line
    $this->setCollection($collection);
    return parent::_prepareCollection();
}

protected function _prepareColumns()
{
    $this->addColumn('table1_id', array(
        'header'    =>  $this->__('ID'),
        'align'     => 'left',
        'width'     => '50px',
        'index'     => 'table1_id',
    ));

    $this->addColumn('salutation', array(
        'header'    => $this->__('Title'),
        'align'     => 'left',
        'index'     => 'salutation',
        'width'     => '80px',
    ));

    $this->addColumn('f_name', array(
        'header'    => $this->__('First Name'),
        'align'     => 'left',
        'index'     => 'f_name',
        'width'     => '100px',
    ));

    $this->addColumn('l_name', array(
        'header'    => $this->__('Last Name'),
        'align'     => 'left',
        'index'     => 'l_name',
        'width'     => '100px',
    ));

    $this->addColumn('subscribed', array(
        'header'    =>  $this->__('Subscribed'),
        'align'     => 'left',
        'width'     => '80px',
        'index'     => 'Subscribed',
        'type'      => 'options',
        'options'   => array(
            0 => 'Subscribed',
            1 => 'Not Subscribed',
        ),
    ));//additional column

table1 has table1_id, salutation, f_name, l_name

table2 has table2_id, subscribed

First I added the new column and that displayed fine, then I added the join statement, but that returned an

  Integrity constraint violation: 1052 Column 'table1_id' in on clause is ambiguous

So its obviously something to do with $collection->join() but what have I done wrong? I wasn't sure if it was due to the order I place the tables but reordering them failed, i'm obviously missing something

===EDIT===

$collection = Mage::getModel('module/model')->getCollection();
$collection->getSelect()->join( array('options'=>$this->getTable('module/table2')),'main_table.table1_id = options.table2_id','options.*');


texts: Unable to add to cart configurable product with swatches Magento 1.9.3

texts: I have create the configurable product and assign attribute as swatches instead of drop-down. Swatches will display properly but unable to work for add to cart process like freeze when click on any swatch.


texts:
i need add class into body by phtml file NOT xml

i try

    <?php
      if ($root = $this->getLayout()->getBlock('root')) {
      $root->addBodyClass('whatever');
      }
    ?>

but not working


texts: How/Where to override Magento 2 order page?

texts:
I'm very new to development in Magento so I would appreciate someone just pointing me in the right direction.

I would like to make a few modifications to the functionality of the default Magento 2 orders page. For example, adding a "Cancel Order" button. I found the place in the core code where this page is being displayed. So the extract below is from vendor\magento\module-sales\view\frontend\templates\order\history.phtml

            <?php foreach ($_orders as $_order): ?>

                    <td data-th="<?= $block->escapeHtml(__('Order #')) ?>" class="col id"><?= /* @escapeNotVerified */ $_order->getRealOrderId() ?>
                    <td data-th="<?= $block->escapeHtml(__('Date')) ?>" class="col date"><?= /* @escapeNotVerified */ $block->formatDate($_order->getCreatedAt()) ?>
                    <?php $extra = $block->getChildBlock('extra.container'); ?>
                    <?php if ($extra): ?>
                        <?php $extra->setOrder($_order); ?>
                        <?= /* @noEscape */ $extra->getChildHtml() ?>
                    <?php endif; ?>
                    <td data-th="<?= $block->escapeHtml(__('Ship To')) ?>" class="col shipping"><?= $_order->getShippingAddress() ? $block->escapeHtml($_order->getShippingAddress()->getName()) : '&nbsp;' ?>
                    <td data-th="<?= $block->escapeHtml(__('Order Total')) ?>" class="col total"><?= /* @escapeNotVerified */ $_order->formatPrice($_order->getGrandTotal()) ?>
                    <td data-th="<?= $block->escapeHtml(__('Status')) ?>" class="col status"><?= /* @escapeNotVerified */ $_order->getStatusLabel() ?>
                    <td data-th="<?= $block->escapeHtml(__('Actions')) ?>" class="col actions">
                        <a href="<?= /* @escapeNotVerified */ $block->getViewUrl($_order) ?>" class="action view">
                            <?= /* @escapeNotVerified */ __('View Order') ?>

                        <?php if ($this->helper('Magento\Sales\Helper\Reorder')->canReorder($_order->getEntityId())) : ?>
                            <a href="#" data-post='<?php /* @escapeNotVerified */ echo
                            $this->helper(\Magento\Framework\Data\Helper\PostHelper::class)
                                ->getPostData($block->getReorderUrl($_order))
                            ?>' class="action order">
                                <?= /* @escapeNotVerified */ __('Reorder') ?>

                        <?php endif ?>

            <?php endforeach; ?>

The problem is I know it's a bad idea to make direct changes to this code, would I need to create a new theme or a new module to overwrite this file?

I am quite overwhelmed by the system so far, if I read through the Magento 2 PHP Development documentation will that be enough to grasp what is needed to be done or are there extra resources that I can consume? I'm just trying to figure out the best way to learn Magento 2 Development.


texts: Magento 2: How to get Browser Session ID in custom module

texts:
I need to get Browser Session ID in my custom module.

Does any have idea how to get Browser Session Id in custom module.

Any help would be appreciated. Thanks!


texts: GridFactory getting generated into wrong location

texts:
I have a custom module with backend management.

I have an observer on config save that uses the file upload to read submitted file to update the collection however this fails due to below;

class \My\MODULE\Model\Grid does not exist

Caused by, for some reason, when compile/content-deply is run and the generation is creating the GridFactory in;

generated\code\My\MODULE\Model\GridFactory.php
// ** should be in generated\code\My\Module\Model\GridFactory.php **

This is the issue, not sure why this is both capitalizing the Module name & then of course, generating this into incorrect location hence breaking any functionality (although admin forms are working for this module on save) and I can see other generation items are created in the correct location.

I have other modules copied & refactored/renamed but are not having the same issue at all...


texts: How to get the Database Details in custom php file Magento 2?

texts:
I added the custom.php file in the magento-2 root folder and I want to get the database details from env.php file

'db' =>
  array (
    'table_prefix' => '',
    'connection' =>
    array (
      'default' =>
      array (
        'host' => '127.0.0.1',
        'dbname' => 'magento',
        'username' => 'root',
        'password' => '4gile-123',
        'active' => '1',
      ),
    ),

Can any please help to get database details.


texts: Getting error message: Some transactions have not been committed or rolled back

texts:
This is my code. I am trying to create a credit memo in an observer:

        $OldOrder = Mage::getModel('sales/order')->loadByIncrementId(12132332);

        $invoicesAll = [];
        $invoices = $OldOrder->getInvoiceCollection();

        foreach ($invoices as $invoice){
            $invoicesAll[] = $invoice;
        }
        $service = Mage::getModel('sales/service_order', $OldOrder);
        foreach ($invoicesAll as $invoice) {
            try {
                $creditMemo = $service->prepareInvoiceCreditmemo($invoice);
                $creditMemo->save();
//                $creditMemo->refund();
            }catch(Exception $e){
                var_dump($e->getMessage());
            }
        }

I didn't receive any errors in browser just on the system.log:

Some transactions have not been committed or rolled back  in /opt/lampp/htdocs/.../lib/Varien/Db/Adapter/Pdo/Mysql.php on line 4039

I tried to use refund or save. But I still get this.
Any ideas why ?


texts:
Currently we have a store setup on a single domain with 2 languages. Where the URL's look like this:

Dutch: http://www.example.com/nederlandse_product_url
English: http://www.example.com/english_product_url

When you're in the dutch storeview on the frontend and types in the dutch URL in the address bar, there's no problem. The same for English.

But if you're on the English view and you type in the Dutch URL in the address bar, you get a 404 error.

Is there anyway to check from which storeview the url is and direct the visitor to the correct storeview, without changing the url structure?


texts:
I'm just wondering why this plugin seems to be requesting a resource through http on a site that is fully https forced.

I am fully baffled on how this is happening seeing that there is no reference to http within the plugins code as far as I can see.

Essentially, my question is if there is a way to redirect this request to https somehow through magento as the XMLHTTPRquest seems to try request an unsecure piece of content.