texts: Unrelated attribute error The value of attribute "unrelated" must be set

texts:
Preconditions

Magento 2.1.4
CenOS 6.9, MySQL 5.6.35, PHP 7.0.17, Apache 2.4.25

Steps to reproduce

Go to Products - Add Product - Grouped Product - and create a product based on an attribute set you know does not include certain attributes.
Fill out the pertinent information for the product and then add products to group.
Select a number of Simple Products (not visible individually)
Add pictures and then Save.

Expected result

The Grouped Product should be created

Actual result

An error message appears "The value of attribute "bra_band_size" must be set, an attribute that is not being used to create the Grouped Product.
https://www.dropbox.com/s/7nqysiff600qonj/Unrelated%20value%20of%20attribute%20error.mp4?dl=0

Steps to reproduce

Go to Products - Add Product - Grouped Product - and create a product based on an attribute set you know does not include certain attributes.
Fill out the pertinent information for the product and then save the product without adding any products to the Group
Save the product

Expected result

The Grouped Product should not be saved

Actual result

The error message does not appear if you do not include any products to Group and saves without issues.
https://www.dropbox.com/s/5gtf4rxn10sp5os/grouped%20product%20is%20saved%20when%20no%20product%20is%20included.mp4?dl=0

Steps to reproduce

Open the Grouped Product that was saved without any products added.
Add the products to Group and then save.

Expected result

The Grouped Product should not save and have the same attribute related error message.

Actual result

The Grouped Product is saved, but it is shown as out of stock despite all of the added Products are in stock.
https://www.dropbox.com/s/jl9vm8xroy0ei3x/product%20can%20be%20added%20later%20but%20shown%20as%20out%20of%20stock.mp4?dl=0


texts: Strange arrays being output on front-end instead of website

texts:
Trying to setup version control on a pre-existing client's site. There have been a number of developers who have had their hands in this and I'm slowly modifying the .gitignore file in attempt to bring over all the necessary files. It's a real mess but somehow running in production. :D

I'm currently getting an array output on my front-end that is something like this repeated about 50 times on my local environment:

Array ( [0] => Array ( [file] => /Users/deeperdata/Documents/webroot/website/lib/Zend/Db/Adapter/Pdo/Mysql.php [line] => 96 [function] => _connect [class] => Zend_Db_Adapter_Pdo_Abstract [type] => -> [args] => Array ( ) ) [1] => Array ( [file] =>

I checked Apache, PHP and Magento logs. I'm showing nothing. Any ideas?


texts: How do I target a class in the Model directory of a custom plugin with crontab in Magento 2

texts:
As the title suggests I'm having some trouble targeting three custom classes I want to run on a schedule. The crontab.xml below returns the following error:

PHP Fatal error:  Uncaught Error: Class 'NameSpace\Module\PHPFileWithMyClass' not found in /var/www/domain.com/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:93

crontab.xml:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
    <group id="default">
        <job name="job-name" instance="NameSpace\Module\PHPFileWithMyClass" method="execute" >
            <config_path>crontab/default/jobs/config_path_works/schedule/cron_expr</config_path>
        </job>
        <job name="job-name2" instance="NameSpace\Module\PHPFileWithMyClass2" method="execute" >
            <config_path>crontab/default/jobs/config_path_works/schedule/cron_expr</config_path>
        </job>
        <job name="mjob-name3" instance="NameSpace\Module\PHPFileWithMyClass3" method="execute" >
            <config_path>crontab/default/jobs/config_path_works/schedule/cron_expr</config_path>
        </job>
    </group>
</config>

My file structure is as follows:

NameSpace
-/Module/
--/etc/
---crontab.xml
--/Model/
---PHPFileWithMyClass.php
---PHPFileWithMyClass2.php
---PHPFileWithMyClass3.php


texts: How to add Store Language in my custom header part

texts:
I have integrated html theme in Magento and now I have to add store language in my custom header part.
How can I do this ?
Can any one help me ?


texts:
I want to add a custom column in magento order grid which should have a input field to populate. This is for screen purpose only so that agent can see information quickly and populate it.

customer Need extra accessories column

input field (Agent can write yes or no whatever) Like this below

So, I want a idea that from where i can start?


texts: Magento 2: How to get current language of store?

texts:
I'm trying to show a custom block for each store view / language.
Therefore I want to create switch statement like:

$lang = // Get language code or store view code here;
switch ($lang) {

    case 'en':
        // English block
        break;

    case 'nl':
        // Dutch block
        break;

    default:
        // Dutch block
        break;
}

How can I get this? I need it in this file \app\design\frontend\Venustheme\floristy\Ves_Themesettings\templates\header\default.phtml


texts: Why does it make a difference which name I use in the constructor?

texts:
Since the upgrade from 2.2.x to 2.3.3 we have the problem that a customized tier price box is cached across all product pages.

I found a fix for this, by just changing the variable name.

This is the same in both versions:

use Magenerds\BasePrice\Helper\Data as MagenerdsBasePriceHelperData;
use Magento\Catalog\Model\Product;
use Magento\Framework\Json\Helper\Data;
use Magento\Framework\Math\Random;
use Magento\Framework\Pricing\Price\PriceInterface;
use Magento\Framework\Pricing\Render\RendererPool;
use Magento\Framework\View\Element\Template\Context;

class TierPricesWithBase extends \Magento\Catalog\Pricing\Render\PriceBox

This works:

public function __construct(
    Context $context,
    Product $saleableItem,
    PriceInterface $price,
    RendererPool $rendererPool,
    Data $jsonHelper,
    Random $mathRandom,
    MagenerdsBasePriceHelperData $basePriceHelper,
    array $data = []
) {
    parent::__construct($context, $saleableItem, $price, $rendererPool, $jsonHelper, $mathRandom, $data);

    $this->_basepriceHelper = $basePriceHelper;
}

This does not:

public function __construct(
    Context $context,
    Product $product,
    PriceInterface $price,
    RendererPool $rendererPool,
    Data $jsonHelper,
    Random $mathRandom,
    MagenerdsBasePriceHelperData $basePriceHelper,
    array $data = []
) {
    parent::__construct($context, $product, $price, $rendererPool, $jsonHelper, $mathRandom, $data);

    $this->_basepriceHelper = $basePriceHelper;
}

Only difference is the variable name $product.

How can the behavior differ? Is the object manager doing some reflection here based on variable names here and mess with the caching?

We are using PHP 7.2


texts:
We have installed patches to out Magento sites (v1.9, patches 1533 5994 and 6285 (both versions)).
However, despite installation reported successful, and after taking note of steps in
Applied Patches but still getting a vulnerable message?
We are still being told by http://magento.com/security-patch that the site is vulnerable. Checking on https://templates-master.com/supeechecker lists the 3 patches we have applied as those missing.
Is there any other steps that are required, but not mentioned in the post mentioned above?


texts: How do I get the estimate shipping Country id in Magento 2?

texts:
I am writing a custom shipping rates module, and I can’t seem to figure out how to get the estimate shipping Country ID.

I know how to get the Country id once the order has been created, but not for the estimate shipping portion of the checkout process

Any input is greatly appreciated!

For Magento 1.9 I used this

Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getData('country_id')

Or

Mage::getSingleton('checkout/session')->getQuote()->getBillingAddress()->getData('country_id');


texts: M2E eBay/Amazon Integration Alternative for Magento 2

texts:
We are currently using Magento ver. 2.3.5 and integrate eBay and Amazon into the business. I have been asked by my manager to look into an alternative for M2E as they have just increased the price to an extent that is not longer suitable for the small amount of business we do on those platforms.
We are seeking an extension which will allow us to control stock from the main (Magento) store and update the Amazon and eBay stores automatically, along with being able to list product on these sites via Magento. In addition we would like any orders made on the Amazon or eBay stores to create an order in Magento automatically and reduce stock accordingly.
If anyone could point me to a suitable replacement I would greatly appreciate it.


texts: Magento 2 : Icons are not showing up in magento 2.16

texts: Icons are not showing up in Magento 2.16 . I had already extended the theme and it was working perfectly.


texts: Magento2 - Mysql to duplicate product attribute

texts: Is it possible to via sql duplicate a product attribute and give the newly created one a different attribute code and label? Otherwise have it be a 100% duplicate . I have a ton of attributes I need to create duplicates for and do not want to have to manually create them.


texts: Error when updating Magento admin password: Sorry, but this password has already been used. Please create another

texts:
When logging into Magento (v2.1.2), I am able to successfully login using my password, and then I am immediately redirected to an account page that states 'It's time to change your password'.

Upon updating the password, Magento will not accept any value I enter into it, always displaying the error message

Sorry, but this password has already been used. Please create another.

I know there's no possible way all the combinations I've tried using have previously been used, even making up completely new passwords to try.

I've also manually updated the admin users password through the mysql database, and upon logging in get thrown into the same loop.

Has anybody else dealt with this issue, or have any suggestions?


texts: Get products where multiselect value is false

texts:
how can I get products where the value of a multiselect is not set ?

I've got these so far :

$filter =
    array(
      array('eq' => array("378")), //multiselect with one value
      array('eq' => array("378,379")), //multiselect with 2 values
      array('eq' => false), //multiselect with no value, need to make this work
);

$collection->addAttributeToFilter( "multiselect", $filter );


texts: Determine if attribute has frontend value

texts:
In a little generic exporter I am currently writing I am exporting all products and their attributes that reside in the data array.

For some attributes, it is necessary to translate their integer value into their frontend value (manufacturer, brand ...).

The best way I found to do that so far is this:

$storeviewProduct->getResource()->getAttribute($key)->getFrontend()->getInputType()

However, for all attributes that do not have a frontend value, a FATAL ERROR is thrown:

Call to a member function getSource() on boolean in app/code/core/Mage/Catalog/Model/Product.php on line 1385

It seems that this happens whenever I try to check if this attribute has a frontend value to display. However, I cannot seem to determine if I have to check any frontend value without the FATAL ERROR.

I'd prefer not to tinker with the error settings of my script or install a custom FATAL ERROR handler to catch just this error. I hope that there's a way without iterating over all attributes first, then reading the values for the attribute from the product instead of just iterating over the data array.


texts: how to override step 2 of creating a configurable product magento 2

texts:
I want to override this page :

i want to display for this attribute just the options related to my current product so wich view do i have to override and how to proceed please any help


texts: how to Remove payment method, shipping information and shipping method

texts:
I want remove Shipping Information, Shipping method, and Payment method for now i don't need to add all of this, i only want customer can view product detail and go for checkout.

i tried to remove it at time of checkout it giving me error message that process can not go further for checkout.


texts:
In the Catalog > Products page you can go to Actions > Update Attributes at the top left and then bulk update product stock/quantity/etc.

How can I do this using the Magento PHP PDO but in bulk like this instead of one by one?

i.e. I already have a solution for one by one;

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$productRepository = $objectManager->create('\Magento\Catalog\Model\ProductRepository');
$stockRegistry = $objectManager->create('\Magento\CatalogInventory\Api\StockRegistryInterface');

    $outOfStockProducts = array(1, 3, 4, 5, 9);
    $inStockProducts = array(2, 6, 7, 8, 10);

    //For out of stock products
    foreach($outOfStockProducts as $k=>$id){
        $product = $productRepository->getById($id);
        $stockItem = $stockRegistry->getStockItemBySku($product->getSku());
        $stockItem->setQty(0);
        $stockRegistry->updateStockItemBySku($product->getSku(), $stockItem);
    }

    //For 100 stock products
    foreach($inStockProducts as $k=>$id){
        $product = $productRepository->getById($id);
        $stockItem = $stockRegistry->getStockItemBySku($product->getSku());
        $stockItem->setQty(100);
        $stockRegistry->updateStockItemBySku($product->getSku(), $stockItem);
    }

How can I do this in bulk as the Magento feature does it instead of one by one like the example?
The reason being is that the bulk operation completes almost instantaneously, compared to the one by one method which may take hours to complete.


texts: Magento 2 Data Migration. Redundant tables from M1

texts:
The official docs on migrating data say:

Remove outdated and redundant data from your Magento 1 database before migration.
Such data may include logs, order quotes, recently viewed or compared products, visitors, event-specific categories, promotional rules, etc.

Can anyone say which tables hold this information and I can safely empty?


texts: Magento transactional email template variables assigned are not used by template

texts:
I am trying to send custom email with some variables in it, but don't know what I am doing wrong in it
here is my code :

    $emailTemplate  = Mage::getModel('core/email_template');
    $emailTemplate->loadByCode('custom_email_template');
    //$emailTemplate->loadDefault('custom_email_template');
    //$emailTemplate->load($templateId);
    /* tried all of the above to load template but same results */
    $emailTemplate->setSenderName(Mage::getStoreConfig('trans_email/ident_general/email'));
    $emailTemplate->setSenderEmail(Mage::getStoreConfig('trans_email/ident_general/name'));

    $processedTemplate = $emailTemplate->getProcessedTemplate($templateVariables);

    try {
        $emailTemplate->send($rec_email, $rec_name, $templateVariables);
    }
    catch(Exception $ex) {
        echo Mage::getSingleton('core/session')->addError($this->__($ex->getMessage()));
    }

I added the template from Magento admin panel transactional emails, haven't created any html file for template.

Email is getting sent but variables are shown as

{{ var sender_name }}

{{ var rcver_name }}

{{ var pr_name }}

{{ var order_number }}

Please give me an idea of what I am doing wrong.


texts:
I use IWD OPC and the module pay with stripe, but this is not working. When I click on "place order", it is showing loading, but nothing is happening after that.

You can check the issue on growerline.com

Have any idea for fix this?


texts: Is there an event that fires when the cart/quote is empty?

texts:
I would like to set a quote's shipping method based on the items selected in the quote (only if there is not already a shipping method selected) and unset the quote's shipping method when there are no more items in the cart/quote.

However, I'm having difficulty with part 2 of this problem.  I have tried observing sales_quote_address_save_before, sales_quote_save_after and checkout_cart_save_after and they all exhibit a very odd behavior:

If I add or remove items from the cart, these events fire twice with the new number of items in the cart (so for example, if I had 1 item and added 1 item, it would fire twice with 2 items in the model).

However, if I remove all items from the cart, all three events only fire once with the old number of items in the cart (for example, if I had 1 item in the cart and delete it, the event fires once with 1 item in the model, not 0).

Is there an event that I can use to tell when I have no items in the cart?


texts:
I got an offline payment method and want to change the "Place Order" button to "Place Free Order" when the price is 0.

The button is created in checkmo.htm, however I can't use JS or PHP here.
I am thankful for any suggestion!


texts: UPS shipping method not showing magento 2

texts:
I had integrated Magento UPS XML Shipping module with all live credentials. But What I see is

No shipping Methods Available
 I enabled the debug mode the debug file is below Error code I got is

<AccessRequest xml:lang="en-US">
  <AccessLicenseNumber>MYACCESSKEY</AccessLicenseNumber>
  <UserId>****</UserId>
  <Password>****</Password>
</AccessRequest>
',
  'request' => '<?xml version="1.0"?>
<RatingServiceSelectionRequest xml:lang="en-US">
  <Request>
    <TransactionReference>
      <CustomerContext>Rating and Service</CustomerContext>
      <XpciVersion>1.0</XpciVersion>
    </TransactionReference>
    <RequestAction>Rate</RequestAction>
    <RequestOption>Shop</RequestOption>
  </Request>
  <PickupType>
          03
          <Description>Customer Counter</Description>
  </PickupType>

  <Shipment>      <Shipper>      <Address>
          <City> Pretoria</City>
          <PostalCode>0002</PostalCode>
          <CountryCode>ZA</CountryCode>
          <StateProvinceCode>72 Struben St, Pretoria Central, </StateProvinceCode>
      </Address>
    </Shipper>
    <ShipTo>
      <Address>
          <PostalCode>636009</PostalCode>
          <CountryCode>IN</CountryCode>
          <ResidentialAddress>01</ResidentialAddress>
          <StateProvinceCode></StateProvinceCode><ResidentialAddressIndicator>01</ResidentialAddressIndicator>      </Address>
    </ShipTo>

    <ShipFrom>
      <Address>
          <PostalCode>0002</PostalCode>
          <CountryCode>ZA</CountryCode>
          <StateProvinceCode>72 Struben St, Pretoria Central, </StateProvinceCode>
      </Address>
    </ShipFrom>

    <Package>
      <PackagingType>00</PackagingType>
      <PackageWeight>
         <UnitOfMeasurement>LBS</UnitOfMeasurement>
        <Weight>4</Weight>
      </PackageWeight>
    </Package>  </Shipment>
</RatingServiceSelectionRequest>',
  'result' => '<?xml version="1.0"?>
<RatingServiceSelectionResponse>
<Response><TransactionReference><CustomerContext>Rating and Service</CustomerContext><XpciVersion>1.0</XpciVersion>
</TransactionReference>
<ResponseStatusCode>0</ResponseStatusCode>
<ResponseStatusDescription>Failure</ResponseStatusDescription>
<Error>
<ErrorSeverity>Hard</ErrorSeverity>
<ErrorCode>111057</ErrorCode>
<ErrorDescription>This measurement system is not valid for the selected country or territory.</ErrorDescription></Error>
</Response>
</RatingServiceSelectionResponse>',
) {"is_exception":false} []


texts: Magento 2 Adding field to Account information tab at admin panel

texts:
I have added new customer attribute 'Company' (not to customer_address) and I need to render this in customer_form ui-component at the "Account information" tab.

It's already in customer collection when I check this in magento_root/vendor/magento/module-customer/Model/Customer/DataProvider.php

For implementing
I have added to magento_root/vendor/magento/module-customer/view/base/ui_component/customer_form.xml following:

    <field name="company" formElement="input">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="source" xsi:type="string">customer</item>
            </item>
        </argument>
        <settings>
            <dataType>text</dataType>
        </settings>
    </field>

I also tried:

        <field name="company">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="sortOrder" xsi:type="number">50</item>
                <item name="dataType" xsi:type="string">varchar</item>
                <item name="formElement" xsi:type="string">input</item>
                <item name="label" xsi:type="string" translate="true">Company</item>
                <item name="default" xsi:type="number">0</item>
                <item name="source" xsi:type="string">customer</item>
            </item>
        </argument>
    </field>

But this field doesn't appear at the account information tab!
What am I missing?


texts: What will be the major impacts if I removed all core css from Magento core and changing core class names?

texts:
Im using magento 2.4. I would like to know the impacts of removing all magento core css and changing some of core class names.
As per my understanding below areas will be impact

Magento Upgrade
Security patches
JS (many js depends on core magento class)
3rd party extension and JS

Please share your thoughts and share some official links if you have.
Thank you in advance!


texts: Overidding product saveAction() - reindex issues

texts:
I have created a custom module in which I'm overriding the standard core product saveAction() function (located in app/code/core/Mage/Adminihtml/controllers/Catalog/ProductController.php).

Even if the custom function is an exact copy of the original one, after saving product, Magento shows "One or more of the Indexes are not up to date" message.

Is there some way I could fix this?


texts: Magento 2: Customize each item when adding several items to the cart

texts:
There's a catering company that sells a sandwich. They will only take an order if the customer buys a minimum of 10. Each sandwich can be customized (turkey, ham, egg salad, ...).

Ideal customer interaction would be:

Customer sees a single "sandwich" page
They choose the quantity >= 10 (will not allow under 10. This is currently handled in Advanced Inventory >>  Minimum Qty Allowed in Shopping Cart)
The customer chooses the type for each sandwich, before or after pressing Add To Cart

Is there a way that Magento 2 can handle this customer interaction, without writing a custom extension?


texts:
I added a custom JS validation rule for customer address tax_id field, following this instructions.

But the JS validations can be easely skiped, so how can I reproduce the frontend JS validation in my custom module PHP codes?

Thanks in advance.


texts: How to write google business review API in custom module and call into phtml file

texts:
What is the best approach to write google business review API in custom module and call inside the custom phtml file,
Eg Code:
<?php
$accountId = 'your_account_id';
$locationId = 'your_location_id';

$url = 'https://mybusiness.googleapis.com/v4/accounts/'.$accountId.'/locations/'.$locationId.'/reviews';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
$output = curl_exec($ch);
/*If data is in xml format
$output = simplexml_load_string($output); */
$allData = json_decode(json_encode($output), TRUE); // You will get all the data
?>

How to call the google review thing into my custom phtml file?
I am getting values in Postman:
Url : https://mybusiness.googleapis.com/v4/accounts/123456789/locations/321654987/reviews using header authorization.
I want to display in my custom phtml page, how to write module for this?


texts: how to update an existing Database Table - Newsletter/Subscriber in Magento 1.9.2?

texts:
I am trying to update the existing newsletter_subscriber table by adding 2 more additional columns, and updating the grid view within the Adminhtml by adding those 2 new columns and removing the middle name, website, etc.

Step 1: I successfully updated the front-end portion to include the required information in a phtml pop up and validating the fields.

Below are the basics of what I started for updating the database and moving towards the backend of my tasks, but seem to be getting nowhere. I have books and have been combing through Magento resources, to no avail other than feeling more perplexed.

My config.xml I have tried adding a class within the setup tags

(<class>Mage_Newsletter_Model_Resource_Subscriber_Collection</class>)

but I end up with a

  Fatal error: Call to a member function getReadConnection() on string
  in...Mage/Core/Model/Resource/Db/Collection/Abstract.php on line 134:

    <?xml version="1.0"?>
<config>
    <modules>
        <CollegePark_Newsletter>
            <version>1.0.0</version>
        </CollegePark_Newsletter>
    </modules>
    <global>
        <resources>
            <cp_newsletter_setup>
                <setup>
                    <module>CollegePark_Newsletter</module>
                </setup>
            </cp_newsletter_setup>
        </resources>
    </global>
</config>

app/etc/modules/CollegePark_Newsletter.xml:

<?xml version="1.0"?>
    <config>
        <modules>
            <CollegePark_Newsletter>
                <active>true</active>
                <codePool>local</codePool>
                <depends>
                    <Mage_Newsletter />
                </depends>
            </CollegePark_Newsletter>
        </modules>
    </config>

And last my CollegePark/Newsletter/sql/cp_newsletter_setup/install-1.0.0.php:

    <?php
/**
 * Upgrade script to add columns:
 *
 */

/* @var $installer Mage_Core_Model_Resource_Setup */

$installer = $this;
$installer->startSetup();
$installer->getConnection()
    ->addColumn(
        $installer->getTable('newsletter/subscriber'),
        'subscriber_facility',
        [
            'type'      => Varien_Db_Ddl_Table::TYPE_TEXT,
            'nullable'  => true,
            'comment'   => 'Facility'
        ]
    );

$installer->getConnection()
    ->addColumn(
        $installer->getTable('newsletter/subscriber'),
        'subscriber_zip',
        [
            'type'      => Varien_Db_Ddl_Table::TYPE_TEXT,
            'nullable'  => true,
            'comment'   => 'Zip/Postal Code'
        ]
    );
$installer->endSetup();

So to all you gurus out there, what am I doing wrong???


texts:
In magento 1 if i use the code below file (ex Product) in model directory

<?php

class Crowderia_Demo_Model_Product {

    public function say() {
        echo "Testing";
    }
}

If i use test.php file in project directory I can get the method using mage.php file like below

<?php

require_once 'app/Mage.php';

Mage::app();

$product = new Product;
$product->say();

  How can I do this in magento 2

Please help me I'm new to magento


texts: Use magic methods to access object with integer ID

texts:
I have an instance of a product object:

$_product = $this->getProduct();

Here is a sample from the product object

["media_gallery_images"]=>
object(Varien_Data_Collection)#405 (13) {
  ["_items":protected]=>
  array(1) {
    [1]=>
    object(Varien_Object)#394 (7) {
      ["_data":protected]=>
      array(11) {
        ["value_id"]=>
        string(1) "1"
        ["file"]=>
        string(17) "/h/a/image.jpg"
        ["label"]=>
        string(0) ""
        ["position"]=>
        string(1) "1"
        ["disabled"]=>
        string(1) "0"
        ["label_default"]=>
        NULL
        ["position_default"]=>
        string(1) "1"
        ["disabled_default"]=>
        string(1) "0"
        ["url"]=>
        string(66) "http://domain.domain.domain/media/catalog/product/h/a/image.jpg"
        ["id"]=>
        string(1) "1"
        ["path"]=>
        string(73) "/home/domain/public_html/magento/media/catalog/product/h/a/image.jpg"
      }
      ["_hasDataChanges":protected]=>
      bool(false)
      ["_origData":protected]=>
      NULL
      ["_idFieldName":protected]=>
      NULL
      ["_isDeleted":protected]=>
      bool(false)
      ["_oldFieldsMap":protected]=>
      array(0) {
      }
      ["_syncFieldsMap":protected]=>
      array(0) {
      }
    }
  }

I want to access the "url" inside the object Varien_Object identified by 1 inside the object Varien_Data_Collection identified by "media_gallery_images". This seems easy enough, right?

$url = $_product->getMediaGalleryImages()->get1()->getUrl();

This echos an error into my source:

<b>Fatal error</b>:  Call to undefined method Varien_Data_Collection::get1() in <b>[filepath]

So I'm getting halfway there, but the magic method get1() isn't working. I don't know enough about how these methods work to understand why.

How I access the element that I want to access (["url"])?

SPECIFIC SOLUTION EDIT

Okay so this works specifically for the url

$url = chop($_product->getMediaConfig()->getMediaUrl($_product->getMediaGallery('images')['file']), "/")  . $_product->getImage();

But honestly there has to be a way to do it how I was trying to originally. That "general" solution would save me from running into problems with this further in development.


texts:
How can I enable and use a custom JavaScript file in Magento 2?

I have a theme.js file located at app/design/frontend/<Vendor>/<theme>/web/js and it depends on jQuery. Now I know there are two possible methods for inclusion, via the recommend RequireJS method or directly from within default_head_blocks.xml.

Now, I believe best practice would be to use RequireJS, but I am unfamiliar with this tool and I'm struggling a bit being able to get my theme.js included. Could someone point me in the right direction, please? I've read the documentation, but I'm still unable to grasp the concept properly at this stage and I cannot get it to work.


texts: Request Timeout whist I was creating an attribute set based on default

texts:
Please help I got this error whilst i was creating an attribute set based on default.

Please see attached of what i was trying to do and also the error page.


texts: Magento2 : Manage to currency format in multi language website

texts:
I have two language website like Arabic and English in which currency format is not matching in both store.If product has price 14,751.89 $ then it have show Like this because of Arabic language.

  AR Store : الهندي SAR

  En Store : $ 14 751,89

But I need to show like

  AR Store : 14 751,89 SAR

  En Store : $ 14 751,89


texts:
Referring to my question here: Magento 2 Add custom tab to product details page conditionally

As suggested in the answer, I am trying to hide the custom tab if response is "No Data to display!".

Here is my code:

jQuery(document).ready(function(e){
                        var me = $(this);
                        if ( me.data('requestRunning') ) {
                            return;
                        }
                        me.data('requestRunning', true);
                        //$(document).on('click', '#tab-label-nutrition', function() {
                                    var customurl = "<?php echo $this->getUrl('nutrition/nutrition/index') ?>";
                                    var currentSku1 = '<?php echo $currentSku; ?>';
                                    if(currentSku1 && $(".nutritionFactsContent").children().length == 0){
                                            $.ajax({
                                                    url: customurl,
                                                    type: 'POST',
                                                    dataType: 'html',
                                                    showLoader: true,
                                                    data: {
                                                            sku: currentSku1,
                                                    },
                                                    complete: function(responseData) {
                            if (responseData.responseText == 'No Data to display!') {
                                jQuery('#tab-label-nutrition').hide();
                            } else {
                                alert('hi');
                                jQuery('#tab-label-nutrition').css('display', 'inline-block');
                            }
                            $('.nutritionFactsContent').append(responseData.responseText);
                            console.log('ajax completed');
                            me.data('requestRunning', false);
                        },
                        error: function (xhr, status, errorThrown) {
                            console.log('Error happens. Try again.');
                        }
                    });
                }
                //});//click event
            });

This works well on desktop. However does not work on mobile devices. The alert in the else part is executed though just the css is not applied.

Any help would be appreciated!


texts:
Is there a way to display a product has the price changed using Promotions > Catalog Price Rules on HomePage?

I did a Promotion for a Client Group and I need to show this products as 'featured' or something like this.

I tried using a block: {{block type="filterproducts/newproduct_home_list" product_count="8" column_count="5" template="filterproducts/grid.phtml"}} but didn't had any success.

Thanks


texts: Magento 2 magento_swatch not working properly

texts:
I have one configurable product with "size" and "color" attribute.
I can see "size" and "color" both attribute in English store but in other stores like dutch, Spanish, French .. etc I can not see "size"
attribute in category page or in product page or in the left navigation. I have set "size" attribute "global" so we can use in all
store but it does not show on all store.

you can also check my attached screen shot.

so please help me for resolve this issue.


texts: cannot add additional tab for popular Tag to product view

texts:
can not add popular Tag block in magento tab on product page

            <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml">
                <action method="addTab" translate="title" module="catalog">
                    <alias>description</alias>
                    <title>Description</title>
                    <block>catalog/product_view_description</block>
                    <template>catalog/product/view/description.phtml</template>
                </action>

                <action method="addTab" translate="title" module="catalog">
                    <alias>Tagsssss</alias>
                    <title>Tagssssss</title>
                    <block>tag/popular</block>
                    <template>tag/popular.phtm</template>
                </action>

                <action method="addTab" translate="title" module="catalog">
                    <alias>additional</alias>
                    <title>Additional Information</title>
                    <block>catalog/product_view_attributes</block>
                    <template>catalog/product/view/attributes.phtml</template>
                </action>
            </block>


texts: How to add product weight using program in magento 2?

texts:
I have created a controller and create product from that controller hit.
But on creating the product it successfully created but it doesn't show on froentend but when i manually enable that the item has weight it shows on the froentend.
My controller file is
<?php
namespace Mageplaza\HelloWorld\Controller\Index;

class Index extends \Magento\Framework\App\Action\Action
{
protected $_pageFactory;
private $scopeConfig;
protected $_productCollectionFactory;
private $productAction;
protected $_dir;
protected $productFactory;
protected $productRepository;

public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\Filesystem\DirectoryList $dir,
    \Magento\Catalog\Api\Data\ProductInterfaceFactory $productFactory,
    \Magento\Catalog\Api\ProductRepositoryInterface $productRepository,
    \Magento\Framework\View\Result\PageFactory $pageFactory
    )
{
    $this->productFactory = $productFactory;
    $this->_dir = $dir;
    $this->productRepository = $productRepository;
    $this->_pageFactory = $pageFactory;
    parent::__construct($context);
}

public function execute()
{
  try {
    $product = $this->productFactory->create();
    $product->setSku('sku2');
    $product->setName('Product Name2');
    $product->setDescription("Product Description1");
    $product->setShortDescription("Product Short Description1");
    $product->setWebsiteIds([1]);
    $categories = ["3"]; //create an array of categories which you want to set for the product
    $product->setCategoryIds($categories);
    $product->setWeight(10);
    $product->setTypeId(\Magento\Catalog\Model\Product\Type::TYPE_SIMPLE);
    $product->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH); // To make product visible in both catalog,search
    $product->setPrice("100");
    $product->setAttributeSetId(4); // Attribute set for products
    $product->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED);
    $product->setUrlKey("Product URL Key");
    $product->setStockData(
        array(
            'use_config_manage_stock' => 0,
            'manage_stock' => 1,
            'is_in_stock' => 1,
            'qty' => 1
        )
    );
    $product = $this->productRepository->save($product);
    $product->save();
    } catch (Exception $e){
      echo $e->getMessage();
    }
}
}

How should i add this item has weight enable using this.
Any help is appreciated.


texts:
I have created column name sku in custom grid.

Set href for sku values.

If i click the sku link,it does not go to desire page.

It go to desire page when i press right click and open the link in new tab.

In layout:

<column name="product_sku" class="Xxx\Stock\Ui\Component\Listing\Columns\Product">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="bodyTmpl" xsi:type="string">ui/grid/cells/html</item>
                    <item name="filter" xsi:type="string">text</item>
                    <item name="label" xsi:type="string" translate="true">Sku</item>
                </item>
            </argument>
        </column>

In Product file:

public function prepareDataSource(array $dataSource)
    {
        if (isset($dataSource['data']['items'])) {
            $fieldName = $this->getData('name');
            foreach ($dataSource['data']['items'] as & $item) {
                if (isset($item[$fieldName])) {
                    $productId = $this->_product->getIdBySku($item[$fieldName]);
                    $html = "context->getUrl('catalog/product/edit', ['id' => $productId]) . "' >";
                    $html .= $item[$fieldName];
                    $html .= "";
                    $item[$fieldName] = $html;
                }
            }
        }

        return $dataSource;
    }


texts: Am I allowed to use Javascript in my Magento Connect extension description?

texts:
I can't find any documentation on this and the Magento Connect admin dashboard doesn't provide any metrics as to how many people viewed my extension. I'm trying to treat the Magento Connect marketplace like any other marketing or landing page we have - I would like to track page views. I was going to post a small JS snippet but I didn't want to get banned or suspended so I decided to ask here first before I troubled a Magento rep.

The only "usage policy" I could find was directly under the Edit Extension page where you can change the verbiage. Under the description text box it says Some of HTML tags are allowed. No CSS is allowed.


texts: Where can I find added category related pages in folder in Magento 2?

texts:
I am new to magento 2.I have added 1 category "Clothes" from admin panel.
On front, it shows this url :http://localhost/magento-demo/clothes.html

where Can I find this clothes.html page ?
there is no code folder inside app folder .
Where can I see the code for fetching these categories ?


texts: Magento 2 - How to make responsive layout using child theme css?

texts:
How to override styles-m css to set responsive layout? I just add custom blocks in footer area which are not responsive in mobile view. How to override styles-m in Luma child theme?

Thanks


texts:
So I'm trying to import some images via a CSV to some products in the back end, which are missing images.

Firstly, I have done all kinds of CSV image url formats such as:

| image |
/media/import/0/1/0100.jpg
/import/0/1/0100.jpg
/0/1/0100.jpg
/0100.jpg

But it is still saying 'Image does not exist' When I'm using the profile importer. As well as, 'Skip import row, is not valid value "" for field "type"'.

However, when trying to access the image from the browser/front end, this particular url works http://www.onestopdiy.com/media/import/0/1/0100.jpg

FYI my csv is laid out like

  sku | image | image_label | small_image | small_image_label |
  thumbnail | thumbnail_label

Also the permissions to all of the relevant folders is 777.

So I'm at a bit of a loss, can anyone give me any pointers as to what I should check/go over?

Thanks


texts: Magento 2 : Cache types (When to clear which cache)

texts:
Here i am talking about magento 2 default cache.
I am looking for a clean idea, when to clear which cache.
For example if change made to layout file, we can simply execute one
php bin/magento c:c layout

So, i need idea when i change to any model or php file which cache type need to be cleared ?
also for phtml/js/css files ?
Understanding this will save some time in development as it need to clear one/two cache type not all cache type.


texts: Magento 2 : Layered Filter Navigation Overwrite

texts:
I overwrite Layered Filter navigation, and is working in localhost but not working on server. On server its remove default(core) layered navigation filter  (No Filter block called on category view page).

I check that no other module overwrite layered filter navigation.


texts: Load CMS Block or PHTML file after page load

texts:
I have a PHTML file that loads products based on the data I send via the set data method.

e.g ->setData('xxx', $xxx)

I call this file in another PHTML file numerous times to show all products.

This means it is taking a while for the page to load.

Is there a way I can load the PHTML file or a CMS Block after page load or on click?

I am using this to show the file:

echo $this->getLayout()->createBlock('core/template')->setData('xxx', $xxx)->setTemplate('xxx/xxx.phtml')->toHtml();

Or is there a way to load PHTML or CMS Block in an iframe?


texts:
From this code I could find a logic for getting status label for adminhtml private function getStatusLabelForArea()
Tried to find out how the Order status is translated.
It seems illogical to me and I need help to understand is this bug or feature?
<?php
// Here is code flow as I understand it

Magento\Sales\Model\Order::getStatusLabel();
// returns $this->getConfig()->getStatusLabel($this->getStatus());
Magento\Sales\Model\Order\Config::getStatusLabel($code);
// returns $this->getStatusLabelForArea($code, $area = 'adminhtml');
//   Magento\Sales\Model\Order\Config::getStatusLabelForArea(?string $code, string $area): ?string
//     returns $status->getLabel(); // Magento\Sales\Model\Order\Status
//     !! missing method !! Magento\Sales\Model\Order\Status::getLabel() extends Magento\Sales\Model\AbstractModel
//                                              |
//                                              V
//     !! missing method !! Magento\Sales\Model\AbstractModel::getLabel() extends Magento\Framework\Model\AbstractExtensibleModel
//                                                  |
//                                                  V
//     !! missing method !! Magento\Framework\Model\AbstractExtensibleModel::getLabel() extends Magento\Framework\Model\AbstractModel
//                                                  |
//                                                  V
//     !! missing method !! Magento\Framework\Model\AbstractModel::getLabel() extends Magento\Framework\DataObject
//                                            |
//                                            V
//     !! missing method !! Magento\Framework\DataObject::getLabel()


texts: How to alert in sales_order_save_after observer?

texts:
I am triggering sales_order_save_after event after order status has been completed.

public function execute(Observer $observer) {
    $order = $observer->getEvent()->getOrder();
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $checkoutSession=$objectManager->create('Magento\Checkout\Model\Session');
    $status = $checkoutSession->getLastOrderStatus();
    if( $status == "complete")
    {
        echo "<script>javascript: alert ("message") </script>";
    }
}

and my event.xml file in Vendor/Namespace/etc/adminhtml/event.xml

I just want to show this popup when the order is completed in the admin panel of Magento 2 can anyone help to solve it. and how can I get to know my event is triggered or not.


texts:
Installation of Magento2 went fine, but when i try to access the admin page, it gives me blank login screen.

pub/static has generated css,js correctly for frontend and adminhtml

I see problem with the body section being empty.

When i checked log it is showing this error

main.CRITICAL: Invalid template file: C:\wamp\www\magento2-develop\app\code\Magento\Backend/view/adminhtml/templates/page/js/require_js.phtml

So the templates are not getting correctly linked,

I have deployed Magento2 on WAMP.


texts: Magento 1.9 send cart info to checkout page using soap api

texts: I'm getting cart info in soap api. Now I want to send this cart info to checkout page using soap api. Like there is app and website of store and I get cart info from app and want to send that cart info to checkout page of website for payment means want to redirect to website checkout page from app. So, I want to know what should be the url of checkout page and what parameters I need to pass in url. Is this possible? Can anyone guide me with this please?


texts:
I am noticing really weird problems after installing plugins.

Sometimes the plugins get disappeared in the backend when we refresh the backend and sometimes it appears in the backend.

I havent used magento connect for installing the plugins.

Can this be a caching problems, even though we are using aws for hosting, we have redis cache.

Also after this whatever plugins we installed also has the configuration in the frontend, So once it has disappeared in the backend, this thing also gets disappeared in the frontend as well.

This problem is really gettting more weird and losing conversion very drastically.

Please someone let me know what can be the issue?

Below is the architecture list we are using at our end.


texts: When a product is disabled through admin send a notification email

texts:
Hooking into the event/observer methods already created I could build an email that would send when the status was update to 'status' => 2 correct? After the event has taken place.

I believe I would use this event?

<catalog_product_status_update>
    <observers>
        <sales_quote>
            <class>sales/observer</class>
            <method>catalogProductStatusUpdate</method>
        </sales_quote>
    </observers>
</catalog_product_status_update>

My observer:

class Namespace_Custmail_Model_Observer
{
    public function invoicedStatusChange($event)
    {
        $order = $event->getOrder();
        $orderStatus = $order->getStatus();
        if ($order->getState() == Mage_Sales_Model_Order::STATE_CANCELED)
            $this->_sendStatusMail($order);
    }

    private  function _sendStatusMail($order)
    {
        $emailTemplate  = Mage::getModel('core/email_template');

        $emailTemplate->loadDefault('custom_order_tpl');
        $emailTemplate->setTemplateSubject('Your order was holded');

        // Get General email address (Admin->Configuration->General->Store Email Addresses)
        $salesData['email'] = Mage::getStoreConfig('trans_email/ident_general/email');
        $salesData['name'] = Mage::getStoreConfig('trans_email/ident_general/name');

        $emailTemplate->setSenderName($salesData['name']);
        $emailTemplate->setSenderEmail($salesData['email']);

        $emailTemplateVariables['username']  = $order->getCustomerFirstname() . ' ' . $order->getCustomerLastname();
        $emailTemplateVariables['order_id'] = $order->getIncrementId();
        $emailTemplateVariables['store_name'] = $order->getStoreName();
        $emailTemplateVariables['store_url'] = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB);
        $emailTemplate->send($order->getCustomerEmail(), $order->getStoreName(), $emailTemplateVariables);
    }
}

Basically, anytime a product is disabled send an email. Any help would be greatly appreciated. Thank you.


texts: Magento 2: Problem when enable developer mode

texts:
I have a problem when i enable developer mode:

This is my default.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
  <!–referenceBlock name="privacy-policy-link">
    <referenceBlock name="footer_links">
        <block class="Magento\Framework\View\Element\Html\Link\Current" name="privacy-policy-link">
            <arguments>
               <argument name="label" xsi:type="string">Privacy Policy</argument>
                <argument name="path" xsi:type="string">privacy-policy-cookie-restriction-mode</argument>
            </arguments>
        </block>
    </referenceBlock>
</body>

t
Thanks!


texts:
I would like to find CMS block identifier in Magento backend. The only thing I have is URL. I found many solutions here on SE. But my technical knowledge (or lack of it) does not allow me to perform the operation.

The code I found:

$PageData = Mage::getModel('cms/page')->load($_product->getUrlKey(),'identifier');
echo print_r($BuyingTitle->getData());
exit;

or this:

$current_id = Mage::getBlockSingleton('cms/page')->getPage()->getId();

Where should I put this code? .phtml file? How do I run it?

Edit:

I have a website www.mymagento.com/example/about-us, which was made by an outsource company and where I can't find all the ends. I have access to magento back-end.
When I go CMS -> Pages -> Manage content, I can't find the /about-us page. So I'm trying to retrieve the Identifier of the page with php request, but I'm not very familiar with it.


texts: How can I configure a multi lingual (language) website?

texts:
I have created following store structure;
Website: xxx.de
Store: Germany
Store View: German
Website: xxx.nl
Store: Netherlands
Store View: Dutch
Website: xxx.fr
Store: France
Store View: French
I want to use all languages on other websites too like French and German on xxx.nl with Dutch language. I don't want to create same languages under stores it's to much work for translate and I do use "Add Store Code to URLs " option I will keep it too for all websites.


texts:
I'm looking for solution that will allow me to calculate packaging cost by weight and dimensions.

User will have to pay for:

package up to 30kg - pice I
package fits half-pallet - price II
package required full pallet - price III

Also:

When someone orders 2 items that fits half-pallet, he'll have to pay price II.
When someone orders 3 items that fits half-pallet, he'll have to pay price II + price III.
Smaller products ( up to given weight ) can be mixed with larger ie. items that requires half-pallet, so delivery cost is set to 'price II'

Summary:

I'm looking for extension ( free / paid ) / advice tat will allow me to set proper delivery cost. I'm running Magento 1.6.2.

This reminds me Hanoi tower ;-)


texts: Magento 2.3 - Changing Category Name in specific Store View

texts:
I am using Magento 2.3.0.

I get my products from CSV feed - they are generated and within their generation, also Product Categories are generated.

All of the Product Categories are created under Default Category - all of Store Views use default Category Name values at the moment. It is important that one product has only one Category, which is transated through Store View.

How can I change Product Category Name within specific Store View programmatically?

Any input is appreciated!


texts: many Confirmation Emails being rejected by customers' receiving mail service (confused for spam) How to setup a 3rd party mailing solution?

texts:
We are having a serious problem - many (like 3 or 4 every day) customers never receive their Order Confirmation Email due to the fact that their mail service (whatever that may be) confuses our Order Confirmation Email for spam (which it's not obviously).

What are the possible solutions to this? Someone suggested a 3rd party mailing service - does Google offer this and is that a good service to get? How do you set that up technically?


texts: Magento Read & Write Connection Close Manually Needed

texts:
In case of customisation we need to initiate read and write connection in our .phtml file.

Should we manually close these connection at the end of file? or Magento self handles it?

In my case I have several time called read connections in my templates now I am feeling there must be any other solutions to handle this.

If I use multiple time Read Connection, would it may load up my database or server?

Somewhere I found it to be used.

Read Connection

$db = Mage::getSingleton('core/resource')->getConnection('core_read');

You can close the connection with this:

$db->closeConnection();

And then re-open it with this

$db->getConnection();

Should I do this for handling multiple and concurrent connections?

Let me know if any suggestion.


texts:
We are about to begin working on an addition to Magento 1.14.2 EE that will allow us to merchandise and sort products within categories at a store level.  currently we do this by having 3 entirely separate root category trees, our editors are finding this cumbersome, and our indexing takes 3x the time it should take to reindex a single tree.

The plan is to add a store_id column to the catalog_category_product table which currently stores the product_id, category_id and products position within the category in question.

So my questions are fairly general at this point, has anyone attempted this previously and are there any obvious pitfalls that we are likely to encounter as a result of attempting this?  The solution to us seems fairly obvious yet it hasn't been implemented yet by Magento, surely this is a piece of functionality that would be useful for any company that has a presence in multiple countries.


texts: Missing eav attribute options in collection

texts:
I miss some custom attribute options in my collection.
I'm using the standard "\Mage_Catalog_Model_Product_Type_Grouped::getAssociatedProducts" method.
When I debug the collection inside that method there are not all attributes listed.
By adding load to an item everything is there but I don't need all 124 elements inside only some of them.

foreach ($collection as $item) {
    $item->load($item->getId());
    $associatedProducts[] = $item;
}

As for performance that load method is definitly an overkill but I can't find the problem why it isn't there.
In the database table "eav_attribute_option" I can see every needed attribute but not in the Select-Statement.
I don't it for the product list only on the product detail page. So I haven't tried to enable the option "used in product listing".


texts: M1 PHP7.2 Patch - Customer Registration - "A non-numeric value encountered"

texts:
I encountered an issue with Magento 1.9.2.4 and the PHP7 Patch:

If I choose optional DOB and register without DOB, the logfile shows an error:

2018-10-16T09:45:59+00:00 ERR (3): Warning: A non-numeric value encountered  in /var/www/html/magento1924/lib/Zend/Locale/Math/PhpMath.php on line 94
2018-10-16T09:45:59+00:00 ERR (3): Warning: A non-numeric value encountered  in /var/www/html/magento1924/lib/Zend/Locale/Math/PhpMath.php on line 95

To reproduce:

Backend configuration:
System -> Configuration -> Customers -> Customer Configuration -> Name and Address Options -> Show Date of Birth: "Optional"
Register without submitting a DOB.

I guess the error shows up because magento tries to process the DOB, but it's empty?
So I looked at the lines in PhpMath.php and found that only one parameter in the affected function is tested to be empty. So I added the the same lines for the second one (which works for now).

  lib/Zend/Locale/Math/PhpMath.php

 public static function Sub($op1, $op2, $scale = null)
 {
     if ($scale === null) {
         $scale     = Zend_Locale_Math_PhpMath::$defaultScale;
         $precision = Zend_Locale_Math_PhpMath::$defaultPrecision;
     } else {
         $precision = pow(10, -$scale);
     }

     if (empty($op1)) {
         $op1 = 0;
     }

 +    if (empty($op2)) {
 +        $op2 = 0;
 +    }
 +
     $op1  = self::normalize($op1);
     $op2  = self::normalize($op2);
     $result = $op1 - $op2;
     if (is_infinite($result)  or  (abs($result + $op2 - $op1) > $precision)) {
         #require_once 'Zend/Locale/Math/Exception.php';
         throw new Zend_Locale_Math_Exception("subtraction overflow: $op1 - $op2 != $result", $op1, $op2, $result);
     }

     return self::round(self::normalize($result), $scale);
 }

But over all I don't feel very fine changing functions in the ZendFramework part of Magento, considering that for consistency reasons there are several more changes necessary.

Maybe anyone got any other tips?
Thank you for your recommendations!


texts:
This is in Magento 1.9.x

I am trying to ship a test order and failing miserably. Ive managed to ship other test orders fine, but this one gets to this page, and gives me nowhere to progress forward or no indication of what is wrong - can anyone point me in the right direction please?


texts: Display simple product SKU for configurable products

texts:
How can I include the simple product sku to display for configurable products which have more than two or more drop down options ( two or more attributes)?  I would like the SKU to display after all the selections have been made for the configurable drop downs. Any help with this would be greatly appreciated.

Thanks for looking.


texts: Adding phone number to customer creation page

texts:
I want to add phone number to the customer creation page, since on of our users want's to contact people when they register to their webpage.
I did follow this guide (https://store.magenest.com/blog/add-custom-field-to-registration-page-magento-2/)
But as you can see (http://lommel.no/customer/account/create/) no phone number was added.
I did upgrade - dicompile - content:deploy - reindex and cleared cache. But nothing.
is there something wrong with the guide?
Magento version: 2.3
Theme: Porto
Any help is appreciated


texts: block type="reports/product_viewed" returning the word "empty"

texts:
we added this block to our side block (block call in block). Mage 1.9.0.1

{{block type="reports/product_viewed" template="reports/product_viewed.phtml"}}

Now it only return the word "empty"

question: Is this normal behavior? and what could we do about it?

thanks, Sean


texts:
Anyone can help me set it up so that I can send order emails?

I have already tried configuring an extension SMTP Pro with my gmail account and the test works, but when I try sending an order email, it just notifies me that its already sent. but I don't receive any emails.


texts: Magento 2.1.1 Payment Gateway target URL

texts:
Im trying to make a new payment gateway in magento 2.1.1 that when a customer click on place order button he/she will be redirected to a third party url for example is https://example_payment_carrier.com and the custmer will complete his/her payment there. then after completing a payment the https://example_payment_carrier.com will bring him/her back to https://example_mydomain.com/mygateway/paymentaction

The question is where should I put the third party URL, so that when the place order button is clicked it will post a request including the form data to the third party carrrier?


texts: What are System Requirements for Magento 2.4?

texts: I am using ubuntu 18.04 with PHP 7.3 and MySQL 5.7 Magento 2.3.5 is working fine what are requirements for Magento 2.4


texts: Magento 2 City field not showing in cart for shipping estimation

texts:
We have installed Shippit to calculate rates and it requires the City to be filled out for Australian addresses. This is fine in checkout.

However in the cart there is no city field showing, resulting in no calculation. How do I enable the city field to be present?


texts: Magento2 get Random Order category collection

texts:
i want to random 5 category but not luck for me

i have use below code

$categoryFactory = $objectManager->create('Magento\Catalog\Model\ResourceModel\Category\CollectionFactory');
$categories = $categoryFactory->create()->addAttributeToSelect('*')->setPageSize(5)->getSelect()->orderRand();

Note: order random not working for me


texts: Extend Sales Order Grid to show Printed Yes/No

texts:
I'm trying to add a new column to the sales order grid that shows whether an order has previously had its invoice printed out - I've searched everywhere and can't seem to find a solution.

We use custom grids at the moment and have several custom columns

TIA


texts: Shopping Cart not loading while there are 1000 items in cart ( Magento 1 Enterprise )

texts:
My Shopping Cart is  not loading while i put 1000 different items in cart .
I know it seems odd but we have customers that do that , its a wholesale website . I did change the value of the default magento from 1000 to 10000 https://d.pr/free/i/Pr4uO1 , but still the same issue.
I did the flush of cache, full reindex. Didn`t got any luck on loading the shopping cart. Wonder what is causing the issue and if it is anything else i can update. Is any other way to debug the issue instead of adding 1000 different item in cart ?


texts: Magento 2.2.5 large multi-store catalog categories not updating

texts:
I have a drop down Make Model Year parts finder on my store's front end that uses a three-level category tree with 3,000 subcategories. The same tree is used across five stores with subcategories enabled or disabled depending on the business need.

In Magento 1.7 it was quick and easy to update any level of category. Just set indexing to Manual Update then reindex after updating.

The root parts finder category should be set

  Default > Disabled
  Stores 1 - 5 > Enabled

When migrating to 2.2.5, some category settings were lost. All stores now have the root parts finder catalog Enabled setting with Use Default box checked. I can change the Default Store setting from Enabled to Disabled but cannot stop the other stores from using the default setting. When I uncheck Use Default in any store, then save, the Please Wait for wheel spins for 10 mins before returning a 503 error, and the update is not saved.

My hosting admin has already increased the Apache timeout significantly.

So what I need is a MySQL workaround to uncheck Use Default (Enable) in stores 1-5. I can then change the Default Store from Enabled to Disabled without affecting stores 1-5.


texts: PATCH_SUPEE-10266 Installation Error - Mage_Adminhtml.csv?

texts:
How can i solve,

    patching file app/design/install/default/default/template/install/create_admin.p                                                                            html

    patching file app/locale/en_US/Mage_Adminhtml.csv

can't find file to patch at input line 720

Patch File:

  720th Line :

  '<input class="input-text" type="text" name="product[options][{{option_id}}][image_size_y]" value="{{image_size_y}}">' +

How can i solve the error?


texts:
i am using this code to resolve error 404 admin page problem

     SET FOREIGN_KEY_CHECKS=0;
UPDATE `core_store` SET store_id = 0 WHERE code='admin';
UPDATE `core_store_group` SET group_id = 0 WHERE name='Default';
UPDATE `core_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;

but i have this error message

  Error

SQL query:

UPDATE `core_store` SET store_id =0 WHERE code = 'admin';

MySQL said: Documentation
#1146 - Table 'tests_maga.core_store' doesn't exist

help me please


texts: When is a theme `isEditable` or `isDeletable` in the admin?

texts:
I think I remember seeing a delete button at some point recently on CE 2.1.2 when I go to Content > Designs > Themes > select a theme. Now, I don't for any themes I have (default ones and a custom one). Upon looking at the code, a theme can be deleted if the below condition is satisfied.

/**
 * Check if theme is deletable
 *
 * @return bool
 */
public function isDeletable()
{
    return $this->isEditable();
}

/**
 * Check if theme is editable
 *
 * @return bool
 */
public function isEditable()
{
    return self::TYPE_PHYSICAL != $this->getType();
}

I can't make sense of this because a theme is typically saved as TYPE_PHYSICAL, and I don't see how it's ever changed. Therefore, isEditable() doesn't seem like it would ever return true because it's evaluating 0 != 0.

It appears themes were designed to be added in CLI and perhaps managed entirely via CLI? I have a custom theme record in the theme table, but the theme files are actually not there. I'm trying to clean up the database of this remnant data and re-install a new theme.  Any ideas?


texts: Circle CI integration: composer needs to be authenticated

texts:
I'm setting up Circle CI with Magento 2. Circle has Composer available out of the box, but I'm not sure how to add the repo.magento.com credentials during my builds.

Circle CI has a setting page where you can add Checkout SSH keys, SSH Permissions, API Permission, etc., but I'm not sure if any of these are for Composer. Normally, you would need to update ~/.composer/auth.json with your credentials to access repo.magento.com.

Has anybody set this up properly?

Error I'm getting during the Circle CI build.

Installing magento/framework (100.1.1)
Downloading: Connecting...

[Composer\Downloader\TransportException]
The 'https://repo.magento.com/archives/magento/framework/magento-framework-
100.1.1.0.zip' URL could not be accessed: HTTP/1.1 403 Forbidden


texts: Credit Card (Authorize.net) VS Credit Card (saved)

texts: What is the difference between these two options. on back end they give different outputs and the Credit Card (Authorize.net) does not use 3 digits verification number.


texts:
Every time I run the indexer - elastic search fails and the catalog search is never indexed. I am on Magento 2.4 CE with PHP7.3
Catalog Search index PHP Fatal error:  Uncaught Error: Wrong parameters for Elasticsearch\Common\Exceptions\ServerErrorResponseException([string $message [, long $code [, Throwable $previous = NULL]]]) in /var/www/vm/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php:665
Stack trace:
#0 /var/www/vm/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(665): Exception->__construct(NULL, 503)
#1 /var/www/vm/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php(320): Elasticsearch\Connections\Connection->process5xxError(Array, Array, Array)
#2 /var/www/vm/vendor/react/promise/src/FulfilledPromise.php(28): Elasticsearch\Connections\Connection->Elasticsearch\Connections\{closure}(Array)
#3 /var/www/vm/vendor/ezimuel/ringphp/src/Future/CompletedFutureValue.php(55): React\Promise\FulfilledPromise->then(Object(Closure), NULL, NULL)
#4 /var/www/vm/vendor/ezimuel/ringphp/src/Core.php(341): GuzzleHttp\Ring\Future\CompletedFutureValue->then(Object(Closure), NULL, NULL)
#5 /var/ww in /var/www/vm/vendor/elasticsearch/elasticsearch/src/Elasticsearch/Connections/Connection.php on line 665


texts: How to get the price per store of a product?

texts:
I have different prices in differents websites but I want to show the other store price in a particular store, I tried this:

$storePriceProduct->setStoreId(1)->getFinalPrice();

But always returns the default price, looks like it.

$productModel = $objectManager->create('Magento\Catalog\Model\Product');
$productStore = $productModel->setStoreId(4)->load($product->getId());
var_dump($productStore->getFinalPrice());

I have the product object in the current viewed store available, setting the storeId on top of that and calling getPrice does not work

Magento version 2.2.3


texts: Magento 2: How to create a downloadable product programmatically

texts:
I try to create a import job but I do not know how to create a downloadable product programmatically.

https://www.mageplaza.com/magento-2-create-product-programmatically.html

I readed this site but I have no idea how to do that. How can I insert the download link to the product ? Please advise.


texts: Add standard captcha to registration page

texts:
I want to add the standard captcha from Magento to our customer registration page. Now I saw that you can enable this captcha in the configuration (System -> Configuration -> Customer Configuration -> CAPTCHA -> Enable Captcha on Front-end). But when I do that and I go to the registration page, there is still no captcha. But when I click on the registration button I get the message:

Incorrect CAPTCHA.

Is there somewhere a tutorial or something? Because I only found it for the contact page and nothing for the registration page.

Thanks for your time.


texts: Export order number instead of invoice number

texts:
I got this code:

public function loadInvoice($invoiceno)

  if ($invoiceno instanceof Mage_Sales_Model_Order_Invoice) {
    $invoice = $invoiceno;
  }
  else {
    $invoice = Mage::getModel('sales/order_invoice')->loadByIncrementId($invoiceno);
  }

  $ordernumber = 0;
  $invoice_collection = $invoice->getOrder()->getInvoiceCollection()->getItems();
  if (count($invoice_collection) > 1) {
    $count = 0;
    foreach ($invoice_collection as $key => $value) {
      $count++;
      if ($value->getIncrementId() == $invoice->getIncrementId()) {
        if ($count == 1) {
          $ordernumber = $invoice->getOrder()->getIncrementId();
        }
        else {
          $ordernumber = $invoice->getOrder()->getIncrementId().'_'.$count;
        }
        break;
      }
    }
  }

  if (!$ordernumber) {
    $ordernumber = $invoice->getOrder()->getIncrementId();
  }

And I want to export the order number, instead of the invoice number.


texts: How to update Moneybookers(Skrill) Payment URL

texts:
We are using phoenix/moneybookers extension which comes as default in Magento 1.9.x community edition.

Recently, we get an email from Skrill to update the payment URL from http://www.moneybookers.com/app/payment.pl to https://pay.skrill.com

When can we get updated version for this?
Do you have any patch for this?


texts: Magento 2 How to modify query for list of parent products which have no attribute but child have that attributes?

texts:
I am working on to get all the products that have attributes match.
My current code is

$categoryProducts1 = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
$categoryProducts1->addAttributeToSelect('*');
$categoryProducts1->addAttributeToFilter('price', array('from' => 0, 'to' => 2500));
echo $categoryProducts1->count();
echo "
";
echo $categoryProducts1->getSelect()->__toString();
echo "
";
foreach ($categoryProducts1 as $_pro) {
    echo $_pro->getId().' === '.$_pro->getName();
    echo "
";
}

So here I get only simple products and configureable child products but not the configurable parent one products because the parent product has price 0. So, In this case, I need to display that configurable product too. So I need simple products and configurable parent products only.

So please help me with this.


texts: Calculated Column using Product Custom Attribute in Zend_Db_Expr

texts:
$collection->getSelect()->columns(array('computed' => new Zend_Db_Expr ('custom_attr * (-1)')));

This gives me

Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S22]: Column not found: 1054 Unknown column 'custom_attr' in 'field list''

I'm trying to add a custom column in the collection based from a product attribute.

Note: I just simplified the expression. Tried addExpressionFieldToSelect() but I know it wouldn't work on flat data.

Thank you.


texts: Value for '*' attribute contains incorrect value, see acceptable values on settings specified for Admin in row(s):

texts:
Not sure what is causing this problem.

The previous line which has the same value is valid. But this line is invalid.


texts:
I've followed the instructions here for setting up a child theme. http://alanstorm.com/magento_parent_child_themes

The problem is that even when I set my theme's XML it doesn't fall back to rwd. In fact I don't even think my theme is loading at all.

I created the following:

/app/design/frontend/carl/default/etc/theme.xml

I then changed the package from the default 'rwd' to 'carl'

These give me a homepage with no style at all. So I created a theme.xml containing:

<?xml version="1.0"?>
<theme>
<parent>rwd/default</parent>
</theme>

I reloaded my front page, but still it has no style at all. The correct behaviour should be to fall back to the rwd theme.

All cache is disabled, but I've still flushed it anyway.

On loading the homepage there is no reference to my theme at all.


texts: Product Options not showing on Shopping Cart page for Magento 2

texts:
I did some customization as per the solution provided by Rakesh in following question
Overriding template not working in Magento 2

I have got what I wanted as per the solution mentioned in above question but now the product options for bundle and configurable products are not showing.

Before customization, my shopping cart used to look like this.

After customization

How to get product options to show on Shopping Cart page?


texts: How to add a link on a ui_component button?

texts:
I am learning how to use the Magento 2 UI_Compoenent and I have a question. I noticed there are 2 ways to add 1 button to magento:
1° <button name="back" class="Magento\Customer\Block\Adminhtml\Edit\BackButton"/>
2°
<buttons>
            <button name="add">
                <url path="*/*/new"/>
                <class>primary</class>
                <label translate="true"> back </label>
            </button>
        </buttons>

In the second form inside url = "" I can specify a route and the controller and it will perform an action, but what about the first form? How would I do this? Which would be the most attributed?


texts: How to call an phtml file in CMS page in Magento 2?

texts: I am trying to create an custom .phtml file that will be replacing the home page. How do I call it in the CMS page? In which folder should I place the file for the callout?


texts: after configurable product being imported, on editing it shows attributes to make configurable

texts:
I have successfully imported a configurable product with all it's simple products. But on editing the configurable product from backend, it shows global attributes to make configurable product like the first time i'm creating.

Below is the screenshot of what i see on editing the already imported product.


texts: Magento 1.9 Which database is getQuote()->getGrandTotal() used?

texts:
I have this code in a custom module

Mage::getSingleton("checkout/cart")->getQuote()->getGrandTotal()

Which table and which column does this code getting data from?

First I thought it was the field grand_total from sales_flat_quote, but it's not?


texts: failed while applying security patch SUPEE-6285

texts:
i got error while applying SUPEE-6285 i saw online that i have to apply SUPEE-5994 and i got this error when i  applied:

$ Sh PATCH_SUPEE-5994.sh
Checking if patch can be applied/reverted successfully...
ERROR: Patch can't be applied/reverted successfully.

checking file app/code/core/Mage/Authorizenet/controllers/Directpost/PaymentController.php
Hunk #1 FAILED at 68 (different line endings).
Hunk #2 FAILED at 113 (different line endings).
2 out of 2 hunks FAILED
checking file app/code/core/Mage/Core/Controller/Varien/Router/Admin.php
Hunk #1 FAILED at 129 (different line endings).
1 out of 1 hunk FAILED
checking file app/code/core/Mage/Core/Controller/Varien/Router/Standard.php
Hunk #1 FAILED at 201 (different line endings).
Hunk #2 FAILED at 272 (different line endings).
Hunk #3 FAILED at 297 (different line endings).
3 out of 3 hunks FAILED
checking file app/code/core/Mage/Customer/Model/Customer.php
Hunk #1 FAILED at 273 (different line endings).
1 out of 1 hunk FAILED
checking file app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php
Hunk #1 FAILED at 266 (different line endings).
1 out of 1 hunk FAILED
checking file app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php
Hunk #1 FAILED at 109 (different line endings).
1 out of 1 hunk FAILED
The next patch would create the file app/code/core/Mage/Install/Controller/Router/Install.php,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
checking file app/code/core/Mage/Install/etc/config.xml
checking file app/code/core/Mage/Sales/controllers/Recurring/ProfileController.php
Hunk #1 FAILED at 190 (different line endings).
1 out of 1 hunk FAILED
checking file downloader/Maged/Model/Connect.php
Hunk #1 FAILED at 100 (different line endings).
1 out of 1 hunk FAILED
checking file downloader/Maged/View.php
Hunk #1 FAILED at 162 (different line endings).
1 out of 1 hunk FAILED
checking file downloader/template/connect/packages_prepare.phtml
checking file downloader/template/messages.phtml
checking file get.php
checking file lib/PEAR/PEAR/PEAR.php
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
42 out of 42 hunks ignored
The next patch would create the file lib/PEAR/PEAR/PEAR5.php,
which already exists!  Assume -R? [n]
Apply anyway? [n]
Skipping patch.
1 out of 1 hunk ignored
checking file lib/Varien/Io/File.php
Hunk #1 FAILED at 226 (different line endings).
1 out of 1 hunk FAILED


texts:
I want to unistall an old theme from my Magento. I read for the moment that is possible only from ftp and delete the current folders. I tried from the Magento Connect Manager but my custom theme does not exist in the list.

Is the only choice to unistall the theme via FTP or is it possible in another way?


texts: M2: Bulk remove additional images from specific products

texts:
I need to remove all additional images from +/- specific 600 products. From what I know and have read, it's not possible to do this through the standard CSV import feature.
Is there any trick to do this in Magento 2, without having to remove the products and re-import?


texts: Magento 2 get customer login or not in Js file

texts:
We want to check if customer is login.

Only in that case we want to run particular script in Js file.


texts:
So, after doing a Magmi Import to a product with 'price' included, whilst looking through the product catalog in the back-end of Magento, it will appear as if the product hasn't been changed (price stays as old price) along with looking at the product in a category view in front-end.

However, if going into the actual product editor in the back-end, OR going to the actual product page in front-end, it shows the proper updated price. Also, if you now save the product in back-end, it will save the new price to where it can be seen everywhere properly.

Any idea why this happens and how it can be done to import the new price and have it working in all areas?

MAGmi: v0.7.22 //
Magento: CE1.9.3.2

UPDATE:

I have done the re-indexing and cleared cache many a time, this is actually a recurring issue that I've had for a while, just now taking the opportunity to try and resolve it rather than manually fix.


texts: Get all possible value (dropdown options) of a product attribute in Magento

texts:
I'm trying to display all possible values (dropdown options) of a product in Magento. I'm using the code bellow:

    <?php
  $attribute = Mage::getModel('eav/config')->getAttribute('catalog_product', 'display_size'); //"display_size" is my attribute_code
  $allOptions = $attribute->getSource()->getAllOptions(true, true);
  foreach ($allOptions as $instance) {
    $id = $instance['value'];
    $value = $instance['label'];
  }
?>

but the page doesn't display any results. Any idea?

Thanks, O.


texts: Trying to pass the cc_last4 and approval_code to my function? Help!

texts:
Here is my code:

$getCcInfo = Mage::getModel('sales/order')->getCollection()->getLastItem();
    $order_data = $getCcInfo->getPayment()->getData('additional_information');

    foreach($order_data['authorize_cards'] as $key => $value){

        $transId        = $value['last_trans_id'];
        $ccCard         = $value['cc_last4'];
        $approvalCode   = $value['approval_code'];
    }

And here is where i want to pass these values:

$aWebOrder->CCHTransactionid = $transId;
$aPayment->CreditCardNumber  = $ccCard;
$aPayment->AuthorisationNumber = $approvalCode;

The first error i get is :

Undefined index: authorize_cards

and than these errors:

1. Invalid argument supplied for foreach()
2. Undefined variable: transId
3. Undefined variable: ccCard
4. Undefined variable: approvalCode

When i test these code on my magento root folder it gives me the results i want, it owrks just fine, but when i try to put it on my observer function and try to insert these values on db they get empty.

Any idea guys?


texts: How to enable magento 1.9.2.1 amazon affiliate check out

texts: How to enable amazon check out option in my admin panel magento ver 1.9.2.1?


texts: How to get an attribute of the configured product on cart page

texts:
I am trying to use a custom attribute to indicate to customers what products group together for different promotions using colour codes. I have the attribute and can get the parent product to work so far but need to access the selected child of configured products as different options will group differently.
In templates/cart/item/default.phtml I have this code:
<?php if($product->getTypeId() == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE):?>
<?php if ($product->getData("price_group_colour")): ?>
<span style="color:<?= _______________ ?>;">⬣
<?php endif; ?>
<?php else :?>
<?php if ($product->getData("price_group_colour")): ?>
<span style="color:<?= $product->getPriceGroupColour() ?>;">⬣
<?php endif; ?>

Exactly what do I need to put in that blank to get to the child attribute instead of the parents attribute?
(the attribute values are valid hexcode colours)


texts:
I found product price comes from catalog/product/price.phtml

is there any way in admin > catalog > category > custom deign

to call my custom price.html for specifi category

something like below

<reference name="product.price">
            <action method="setTemplate"><template>catalog/product/view_mour.phtml</template></action>
</reference>


texts: Custom Attribute Search using SearchCriteria

texts:
I have created some custom attribute like city and I need to search how many products I have in a specific city using SearchCriteria.

The SearchCriteria I apply does not filter products on my city attribute and I always get all the products.

This is my code for getting a specific city Products:

   $objectManager =   \Magento\Framework\App\ObjectManager::getInstance();
    $filter_1 = $objectManager
        ->create('Magento\Framework\Api\FilterBuilder')
        ->setField('city')
        ->setConditionType('like')
        ->setValue("Chennai%")
        ->create();
    $search_criteria =$objectManager
        ->create('Magento\Framework\Api\SearchCriteriaBuilder')
        ->setFilterGroups([$filter_group])
        ->create();

    $repo =$objectManager->get('Magento\Catalog\Model\ProductRepository');
    $result = $repo->getList($search_criteria);
    $products = $result->getItems();
    echo count($products);

I can get all the products using the below filter:

   $filter_1 = $objectManager
    ->create('Magento\Framework\Api\FilterBuilder')
    ->setField('city')
    ->setConditionType('like')
    ->setValue("%")
    ->create();

Can you suggest me how to get products filtering on a specific attribute?


texts: How to Migrate Magento 1.9 Module into Magento 2

texts: I use some extensions, such as the extension Alpha search module in Magento 1.9 but this module does not exist for Magento 2, so I need to convert the module to Magento 2. Can you suggest any tool or tips so I can easily convert a Magento 1.9 extension to a Magento 2.0 extension?


texts: I have Installed Magento 2 via composer on subfolder but the my site seems broken. CSS and JavaScript are not loading properly

texts:
I have Installed Magento 2.3.3 via composer on subfolder but the css and java are missed up

I am using WHM/Cpanel


texts: Magento 2 - Connecting to Remote Production Instance and Getting/Setting Entities

texts:
I was wondering if there was a way to have a local instance of Magento 2 connect to a remote instance, and get and/or set entities - outside of using the API?

The reason I am asking is because I am trying to create a data bridge. My local instance has access to an internal database which runs the company's RMS. The local instance can connect to the production database via an SSH tunnel.

The concept would allow the switching of the connection to either populate the development or production environments.

I am relatively new to Magento 2 and did not know if this was feasible, outside of using the API?

Thank you so much for your insight and expertise.

Have a wonderful and blessed day!


texts: Override Community Controller Not Wroking

texts:
This is My Config.xml

<?xml version="1.0"?>
<config>
 <modules>
        <Modulename_PrintPdf>
            <version>1.0.0</version>
        </Modulename_PrintPdf>
    </modules>
    <global>
        <models>
            <ordermanager>
                <rewrite>
                    <observer>Modulename__PrintPdf_Model_Observer</observer>
                </rewrite>
            </ordermanager>
        </models>
    </global>

     <admin>
        <routers>
            <ordermanager>
                <args>
                    <modules>
                   <Modulename__PrintPdf before="Fooman_OrderManager">Modulename__PrintPdf</Modulename__PrintPdf>
                     </modules>
                </args>
            </ordermanager>
        </routers>
    </admin>
</config>

This is My controller in local folder

Mage::log("override");
require('Fooman/OrderManager/controllers/Sales/OrderManagerController.php');

class Modulename__PrintPdf_OrderManagerController extends Fooman_OrderManager_Sales_OrderManagerController
{

        public function indexAction()
            {
                Mage::log("hello");
            }

}

this is my true file

<?xml version="1.0"?>
<config>
    <modules>
        <Modulename__PrintPdf>
            <active>false</active>
            <codePool>local</codePool>
            <depends>
                <Fooman_OrderManager/>
            </depends>
        </Modulename_PrintPdf>
    </modules>
</config>

but now working


texts: Importing orders to Magento - product_options

texts:
I've been tasked with importing from a non Magento store into Magento 1.9. We have over 236k orders that need to be imported. So far I've successfully written services (c#) to manage importing customers, categories, attributes and products directly into mysql. Now I need to do the orders. However, I'm stuck on what the information is in the product_options field that is serialized.

a:1:{s:15:"info_buyRequest";a:2:{s:3:"qty";i:1;s:7:"options";a:0:{}}}

Can anyone point to somewhere that defines what each item is (s:15, a:2, s:3, etc) or explain to me what each item that needs to go into the serialization?

Thanks


texts: Get order ids with status = "canceled/declined"

texts:
currently i'm getting all orders id's from some code on my success.phtml page.

What about if orders get canceled. How to i only pass information along on canceled or declined and would they still hit the success.phtml page... maybe if it was declined after the fact.... ???

Mage::getSingleton('checkout/session')->getLastOrderId().'&event_status=decline'

Obviously the code above gets the id but always (forces) to pass a declined status.

This is part of a rest api but i'm only looking to send orders that have been declined.

event_status='.Mage::getModel('sales/order')->getCollection()->addFieldToFilter('status', 'cancelled')

I only want to pass the order id's that are cancelled. would the above work as the second part?


texts: Mageno 2.2.6 After Changing Images on Products Magento adds .pagespeed.ic.ch0ifsY9Ms.webp to Image url and Image does not load

texts:
As the title says I have been having problems with swatch images not appearing on the front end on the widget on my homepage or on the catalog page. Images do however appear for those very same products on their product pages. And it does not occur on every product.

It seems to occur after I have updated an image for an existing product and not for new products.

I have manually cleaned the generated files, cleaned the cache, reindexed eveything, redeployed static content, and resized images all with no luck.

The main difference between the images that are appearing and those that are not is that the .pagespeed.ic.j4HRSrc9zE.webp is added to the images that are not appearing. I am not sure where this is being added and if there is a way to disable or modify a file somewhere to stop this since its breaking the links.

https://www.apollodesignmade.com/

Edit: I also noticed that it is adding an 'x' before the file name as well for example

cel-24x18-0001-graduation-1.jpg

turns into

xcel-24x18-0001-graduation-1.jpg.pagespeed.ic.ch0ifsY9Ms.webp

I found this issue on github https://github.com/magento/magento2/issues/19710
but my issue seems different since the caching hash is correct, only the file name is prepended and appended and nothing else.


texts:
When I checkout from my website, we are getting Fatal Error as below. I am using Magento 1.9 and I think something happened when I fixing a an issues and recompiled the package.
Can someone please help?

Fatal error: require_once(): Failed opening required
'stripe/lib/Stripe.php'
(include_path='/home/wallpa95/public_html/includes/src:.:/usr/local/php56/pear')
in
/home/wallpa95/public_html/includes/src/Netgains_Stripe_Model_Stripe.php
on line 5


texts: How to add data in env.php(app/etc/env.php) file from controller in magento 2

texts: I need to set some data to the env.php file from my controller.Is there any possible way to do so.


texts:
I would login by email only , without password.

I have Read these two Posts but it not works for me.

Programmatically login a user

https://blog.ancud.de/home/-/blogs/magento-how-to-login-a

I use Magento 1.9

This is my code at the momment:

function loginByEmail($email, $websiteId)
{
    Mage::init('test', 'website');
    // ensure that we are on the correct website
    $customer = Mage::getModel('customer/customer');
    $customer->setWebsiteId($websiteId);
        // the website must be set here again!!!
    $customer->loadByEmail($email);
    $session = Mage::getSingleton('customer/session');

    if ($customer->getId()) {
        $session->setCustomerAsLoggedIn($customer);
        return $session;
    }
}

require_once ( "/var/www/html/app/Mage.php");

Mage::init('test', 'website');
Mage::app("test");

$email = 'test@test.de';
$session = loginByEmail($email,'test');

header('Location: /');

I hope you can help me.

thx a lot

so long Maxwill


texts:
Refused to apply style from

http://localhost/magento2-2.3.5-p1/pub/static/version1593595791/adminhtml/Magento/backend/en_US/extjs/resources/css/ext-all.css

because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.


texts: Magento 2.2.3 :: How to check if ProductCollection exists?

texts:
Here is my problem: I have a vehicle parts site which lets user select their specific model and be saved via a cookie. Then the whole site will be filtered via my module plugin, where I override “Magento/Catalog/Model/ResourceModel/Product/Collection” with the aroundPrepareProductCollection function where I “addattributetofilter” if cookie exists.

I have a megamenu set up on a phtml file with a bunch of categories as an html/css dropdown. (I can provide code.) My issue is that certain vehicle fitments won’t have any products in a few categories. MAIN QUESTION: How can I check whether products exist in a category that’s been filtered, and show them if there are products, and hide if there are not? Kind of like how a layered navigation works (if there is > 0 products in an attribute, show the attribute. If not, don’t show.) My main method I’m thinking is just editing the phtml that contains the megamenu, and add some php in it. But are there other more efficient methods?

The reason this is important is that so users won’t be able to click on a link in the mega menu (which are categories and sub-categories respectively), and then get shown that “We can’t find products matching your selection” aka no products in this category fit your vehicle aka turns people off site. When we can just show them relevant categories in megamenu. Thanks in advanced!!


texts: main.CRITICAL: The stock item with the "37520" ID wasn't found. Verify the ID and try again. System.log - M2 2.3.3

texts:
We get a lot of this type of notice in our system.log, but can't see what is causing this critical notice.
Framework: Magento M2 2.3.3
Have anyone seen this before ?
[2019-11-14 14:00:08] main.CRITICAL: The stock item with the "37520" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:13] main.CRITICAL: The stock item with the "39393" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:14] main.CRITICAL: The stock item with the "5610" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:19] main.CRITICAL: The stock item with the "10691" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:20] main.CRITICAL: The stock item with the "20589" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:22] main.CRITICAL: The stock item with the "47337" ID wasn't found. Verify the ID and try again. [] []
[2019-11-14 14:00:30] main.CRITICAL: The stock item with the "13366" ID wasn't found. Verify the ID and try again. [] []
Hi, check my response. Mark question as answered, if it works for you.


texts: Magento2 catch ajax complete, add to cart

texts: I'm building an custom mini-cart. I want it to update itself when an article is added to the cart. I'm trying to do this by jQuery with catching the ajax complete, but can't get it to work. Can anyone help me?


texts: Can't update product / Unique constraint violation

texts:
Since migration, to Magento 2.3 i can't save any products.

Exception.log reports (when i try to update in default scope) :

[2019-03-21 17:29:07] main.CRITICAL: Unique constraint violation found {"exception":"[object] (Magento\\Framework\\Exception\\AlreadyExistsException(code: 0): Unique constraint violation found at /home/mage4dalvin/public_html/vendor/magento/framework/EntityManager/Operation/Update.php:121, Magento\\Framework\\DB\\Adapter\\DuplicateException(code: 1062): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6-0-2-960.0000-0' for key 'UNQ_E8AB433B9ACB00343ABB312AD2FAB087', query was: INSERT INTO `catalog_product_entity_tier_price` (`entity_id`, `all_groups`, `customer_group_id`, `qty`, `value`, `website_id`, `percentage_value`) VALUES (?, ?, ?, ?, ?, ?, ?) at /home/mage4dalvin/public_html/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php:588, Zend_Db_Statement_Exception(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6-0-2-960.0000-0' for key 'UNQ_E8AB433B9ACB00343ABB312AD2FAB087', query was: INSERT INTO `catalog_product_entity_tier_price` (`entity_id`, `all_groups`, `customer_group_id`, `qty`, `value`, `website_id`, `percentage_value`) VALUES (?, ?, ?, ?, ?, ?, ?) at /home/mage4dalvin/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 23000): SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '6-0-2-960.0000-0' for key 'UNQ_E8AB433B9ACB00343ABB312AD2FAB087' at /home/mage4dalvin/public_html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []

AND (When i try to update in Store View Scope)

[2019-03-21 17:29:31] main.CRITICAL: Notice: A non well formed numeric value encountered in /home/mage4dalvin/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Option.php on line 175 {"exception":"[object] (Exception(code: 0): Notice: A non well formed numeric value encountered in /home/mage4dalvin/public_html/vendor/magento/module-catalog/Model/ResourceModel/Product/Option.php on line 175 at /home/mage4dalvin/public_html/vendor/magento/framework/App/ErrorHandler.php:61)"} []

All ideas are welcome.
Thanks for your help.


texts: Magento2: what is the difference between layout and page_layout?

texts: As I dig deeper in Magento 2, I noticed that there are layout and page_layout file? What are the differences between the two?


texts: Magento join query with group by and having error

texts:
join query with customer table, and group by and having clauses not working, its show an error , filed is not found.

The Query

$collection = $this->getCollection();
        $collection->addAttributeToSelect('userid')->addAttributeToSelect('firstname')->addAttributeToSelect('lastname')->addAttributeToSelect('profile_image')->addAttributeToSelect('specialist')->addAttributeToSelect('latitude')->addAttributeToSelect('free_consult')->addAttributeToSelect('longitude')->addAttributeToFilter('group_id',Federallawyer_Customer_Helper_Data::LAWYER);
 $collection->getSelect()->join(array('review'=>'flrating'),"e.entity_id = review.reviewed_user_id ",array('avg_rating'=>'AVG(review.avg_rating)'));
                $collection->getSelect()->group('review.reviewed_user_id');
$collection->getSelect()->having('avg_rating > ?', $min)