texts: Magento 2.3: After install Magento by CLI not work upgrade command

texts:
After Install Magento2.3 by cli and when try upgrade command getting below Error:

php bin/magento setup:upgrade

  The directory "generated/code/Magento/Backend/App/Request" cannot be deleted Warning!rmdir(generated/code/Magento/Backend/App/Request): Directory not empty The directory "generated/code/Magento/Catalog/Model/ResourceModel" cannot be deleted Warning!rmdir(generated/code/Magento/Catalog/Model/ResourceModel): Directory not empty The directory "generated/code/Magento/Catalog/Ui/DataProvider" cannot be deleted Warning!rmdir(generated/code/Magento/Catalog/Ui/DataProvider): Directory not empty The directory "generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext" cannot be deleted Warning!rmdir(generated/code/Magento/CatalogSearch/Model/ResourceModel/Fulltext): Directory not empty The directory "generated/code/Magento/Directory/Helper" cannot be deleted Warning!rmdir(generated/code/Magento/Directory/Helper): Directory not empty The directory "generated/code/Magento/Eav/Model/Adminhtml/System/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Eav/Model/Adminhtml/System/Config): Directory not empty The directory "generated/code/Magento/Framework/App/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/App/Config): Directory not empty The directory "generated/code/Magento/Framework/Data/Argument" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/Data/Argument): Directory not empty The directory "generated/code/Magento/Framework/Event/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/Event/Config): Directory not empty The directory "generated/code/Magento/Framework/ObjectManager/Config/Reader" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/ObjectManager/Config/Reader): Directory not empty The directory "generated/code/Magento/Framework/Session/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Framework/Session/Config): Directory not empty The directory "generated/code/Magento/Swatches/Block/Adminhtml/Product/Attribute" cannot be deleted Warning!rmdir(generated/code/Magento/Swatches/Block/Adminhtml/Product/Attribute): Directory not empty The directory "generated/code/Magento/Ui/Config" cannot be deleted Warning!rmdir(generated/code/Magento/Ui/Config): Directory not empty

Any one can help me for this. I have already set write/read all permission.


texts: How to have InstallData run before another module?

texts:
I would like my module's Setup\InstallData be run before another module's Setup\UpgradeData. Is that achievable?

In my module's etc/module.xml I've added:

<sequence>
    <module name="Magento_Cms"/>
</sequence>

But that doesn't seem to help – Setup\InstallData of my module still gets called only after Magento\Cms\Setup\UpgradeData.

(EDIT: OK, I realised that this sequence would actually act in reverse - ensure loading the Cms module before mine.)

For now, I've added my data installation code into Setup\InstallScheme which does get run before Magento\Cms\Setup\UpgradeData, but that seems more like a work-around, because the code changes data not DB structure. Also, I'm not sure that Setup\InstallScheme doesn't get run before just by chance...


texts: 'the shipment email is not sent' message in order details

texts:
I have this message in orders:

  Shipment #400001878 | Dec 10, 2017 4:55:20 PM (the shipment email is
  not sent)

I use myparcel for shipment methods.
confirugation->sales emails->shipment->Yes

order email confirmation is sent to customers. How to debug this? please help
ps: Magento 1.9.3.7


texts: If I need to add a new full width section between the main element and the footer element, is there a way to declare something in the theme's default.xml that places it before or after a container?


texts: Magento 1.9.1 swatches don't swap images

texts:
I've modified my custom template to be able to use swatches with it.
(Applied this solution How to use Magento 1.9.1.0 Configurable Swatches in Default package theme (or a custom theme)?)

Everything is working fine except swapping images. When I click on color swatches, nothing happening!
I have my labels filled out but still no chance.
When I get to debugging I found the following errors:

[Error] ReferenceError: Can't find variable: PointerManager
onOptionOver (swatches-product.js, line 483)
(anonymous function) (swatches-product.js, line 319)
(anonymous function) (prototype.js, line 391)
responder (prototype.js, line 5598)

[Error] ReferenceError: Can't find variable: PointerManager
onOptionOut (swatches-product.js, line 540)
(anonymous function) (swatches-product.js, line 325)
(anonymous function) (prototype.js, line 391)
responder (prototype.js, line 5598)

[Error] ReferenceError: Can't find variable: $j
updateImage (product-media.js, line 150)
updateSelect (swatches-product.js, line 728)
onOptionClick (swatches-product.js, line 468)
(anonymous function) (swatches-product.js, line 313)
(anonymous function) (prototype.js, line 391)
responder (prototype.js, line 5598)

Any help will be much appreciated.


texts:
I have an issue with the confirmation password validation on creating the account and reset password pages and showing the following error although the passwords match?

  Please enter the same value again.

Any ideas on how to resolve the issues? I haven't got any JS console errors.


texts: programatically saved custom option not reflection

texts:
I am using below code to add custom option to products programatically , they are getting saved in backend but not reflection in frontend until i click save product from backend , please let me know what i am missing
$product = $objectManager->create('\Magento\Catalog\Model\Product')->load($productId);
$values = [
    [
        'record_id'=>0,
        'title'=>'Red',
        'price'=>10,
        'price_type'=>"fixed",
        'sort_order'=>1,
        'is_delete'=>0
    ],
    [
        'record_id'=>1,
        'title'=>'White',
        'price'=>10,
        'price_type'=>"fixed",
        'sort_order'=>1,
        'is_delete'=>0
    ],
    [
        'record_id'=>2,
        'title'=>'Black',
        'price'=>10,
        'price_type'=>"fixed",
        'sort_order'=>1,
        'is_delete'=>0
    ]
];

print_r($values);
print_r($valueso);

$options = [
    [
        "sort_order"    => 1,
        "title"         => "Denomination",
        "price_type"    => "fixed",
        "price"         => "",
        "type"          => "drop_down",
        "is_require"    => 1,
        "values"        => $values
    ]
];

$product->setHasOptions(1);
$product->setCanSaveCustomOptions(true);
foreach ($options as $arrayOption) {
    $option = $objectManager->create('\Magento\Catalog\Model\Product\Option')
            ->setProductId($productId)
            ->setStoreId($product->getStoreId())
            ->addData($arrayOption);
    $option->save();
    $product->addOption($option);
}


texts:
I try to figure out how to setup price configuration on magento2. Having a base product which has a base price on 1 item I want to attach to this product multiple configurations for 50 item and 100 item  with different prices

Product_1 -1 item  --- 30 usd
  ---- Product_1_1 - 50 items - 56usd
  ---- Product_1_1 - 100 items - 86usd

all derived configurations should be visible in tab.

How would I do this?


texts: How can I add classes to the main product-page blocks in Magento 2?

texts:
I am working on a Magento 2.1.7 shop and  I have created a (custom) child-theme of Magento Blank.

On the product page, I need to add Bootstrap classes to the code below

like this

so that it aligns nicely.

My catalog_product_view.xmlfile contains this code:

<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <move element="product.info.main" destination="content" before="product.info.media"/>
    <move element="product.info.main" destination="content" before="product.info.details"/>
    <move element="product.info.details" destination="main"/>
    <referenceContainer name="catalog.product.related" remove="true" />
    <referenceContainer name="div.sidebar.main" remove="true" />
    <referenceContainer name="main" htmlClass="product-info">
    </referenceContainer>
</page>

Questions:

In what files can I find the code for the "Product photo" and "Product info" blocks?
If it is the case, where, in my custom theme shell I copy them to overwrite the defaults safely (irreversibly)?


texts: Soap API - How to get request by Limit 10 based on pagination?

texts:
I am getting products list using catalogProductList, its taking too long time to return the values(see screenshot) actually my products count is 24K, how can i run by using limit 10 and if i click page 2 then only load next 10 (Now load everything then only print the value).

Now my design look like,

Code :

$proxy = new SoapClient('www.abc.com/api/v2_soap/?wsdl=1');
        $sessionId = $proxy->login((object)array('username' => 'abc', 'apiKey' => 'abc123'));
        $result = $proxy->catalogProductList((object)array('sessionId' => $sessionId->result, 'filters' => null));
        return $result->result();

Note : https://datatables.net/examples/styling/bootstrap4

How to run API  soap v2 as limit 10, and should be next 10 load when i click page 2?


texts:
It seems like I am the only one who cannot make use of addImageToGallery(), as I found many solutions of importing images to/with a product through this function.

First of all, I cannot use directly $product->addImageToGallery() as I found in all the examples, because I get error to call it on a non-object. Maybe because my $product is a SimpleXMLElement object. Therefore I went to this solution:

$model = Mage::getModel('catalog/product');
$product->$model->addImageToMediaGallery($filePath, array('image', 'small_image', 'thumbnail'), false, false);

I don't know if that is correct and if it is working, because my overall solution is not working. That was first.

Second, for a new product, the image gallery is null, so it has to be set. As I found in many examples, people use $product->setMediaGallery(). That's cool and easy. Too bad that there is NO such function in the API. What is going on around here?!

Third, I am lost and have no idea how to proceed. I also tried the old goodie way: here go down to the end of Page 3, where he talks about Product Image.

That is my overall code, that I have, and that doesn't work:

    $model = Mage::getModel('catalog/product');
    $product->$model->setMediaGallery(array('images'=>array (), 'values'=>array ()));
    $filePath = $importImagesDirectory.$this->_getPresentationAttributeValue($product, '@Art="Bild" and @Rang="1"'); //this gives me full path of the image. It's correct, no worries.
    $product->$model->addImageToMediaGallery($filePath, array('image', 'small_image', 'thumbnail'), false, false);


texts: magento 2 layered navigation on CMS page or homepage with selected category

texts:
I want layered navigation on CMS page with selected cateogry. I am following this link

It is showing all category and attribute. But I don't know how to set selected category. For example on Clothing CMS page want to show attributes of  Shirt category in layered navigation.


texts: Magento 2: How to override the crontab.xml of CustomModule1 from CustomModule2?

texts:
How can I override the crontab.xml of CustomModule1 from CustomModule2?

I know that if it was a Magento module from vendor I could just use the same path on app/code to override it, but I need a way to change the schedule on the crontab.xml of an extension that wasn't installed with composer, without changing the original.


texts: Category tree not showing on admin's product edit page?

texts:
I have a store in magento c.e 1.8 i have created categories but the category tree is not not showing up on product edit section.

I can see the categories in Manage Categories section.

Please help if someone know about this problem.


texts: Checkout session return 0 in magento 1.9.2.4

texts:
i am facing an issue in checkout session in version 1.9.2.4.
using

Mage::getSingleton('checkout/cart')
                    ->getQuote()
                    ->setCouponCode($coupon)
                     ->collectTotals()
                        ->save();

code i am trying to set coupon code programmatically, it does work in older version but not in magento version 1.9.2.4.
if i print

 Mage::getSingleton('checkout/session')->getQuote()->getTotals();

it returns 0 while cart have item.
Thanks in advance for any kind of help.


texts: How to use logo in custom Magento module

texts:
So I have created a custom module that requires the insertion of the Magento logo. Module logic is complete and working as it should. In my .phtml file I need to call for the template logo and I'm trying to accomplish this by calling the standard code used in the Magento base theme:

 <?php echo $this->getLogoAlt() ?>
  <a href="<?php echo $this->getUrl('') ?>" title="<?php echo $this->getLogoAlt() ?>" class="logo"><img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" />

This does not working and I'm clearly missing something here. Should extend a class or something to get this working? Funny thing is that I do get the "href" returned...


texts: What is purpose of gift option in magento 2?

texts: There is a gift option tab in back-end magento 2 with each product,what is use of that option and its purpose?


texts: Find extension so customer can change excluding VAT to including

texts:
My website wants to sell to both private persons and companies and I am looking for a popup that appears when customers come to the page for the first time where they can choose whether they are a private person or a company. And depending on their choice, the prices are shown including VAT or without VAT.
I haven't been able to find any extension that can do this for me. Is there anything like this or do I have to code it myself?
I have been looking at these:

Product prices including/excluding tax dependent customer session
https://www.anowave.com/marketplace/magento-extensions/magento-tax-vat-switch-menu/
https://meetanshi.com/magento-2-vat-exemption.html
https://www.taxjar.com/guides/integrations/magento2/


texts: Magento 2 - How to get product custom option values in custom file?

texts:
I want to override custom options template file.I want to show static image with each option value. I just create a custom file in Catalog module but don't know how to achieve this task?

  app/design/frontend/Occasionwear/m2-theme/Magento_Catalog/templates/product/view/custom.phtml

Need help.
Thanks


texts: Data Fetch Error And Images are not Loading (Display) in PWA Magento 2.3

texts:
I managed to run Venia frontend however facing the same issue. I have installed PWA venia in frontend magento 2.3.1 but images are not loading. Here are the comments to your questions. Please Help with your suggestions

Magento version : 2.3.1

Operating System + version:   Ubuntu Linux 16.04

node.js version (node -v):    v10.15.3

Yarn Version: 1.15.2

Note: Yes, Images are loading in local instance.

file / folder permissions yes

My instance is running on HTTPS

Please check the screenshot.


texts: PHP Stan error Service 'errorFormatter.github' Multiple services of type PHPStan\Command\ErrorFormatter\TableErrorFormatter

texts:
I am facing an error after running below command:

vendor/bin/phpstan analyse -c dev/tests/static/testsuite/Magento/Test/Php/_files/phpstan/phpstan.neon app/code/Vendor/CustomModule --level 0

Error:

In Resolver.php line 442:

  Service 'errorFormatter.github' (type of PHPStan\Command\ErrorFormatter\GithubErrorFormatter): Multiple services of type PHPStan\Command\ErrorFormatter\TableErrorForma
  tter found: errorFormatter.filtered, errorFormatter.table (needed by $tableErrorformatter in __construct())

In Autowiring.php line 50:

  Multiple services of type PHPStan\Command\ErrorFormatter\TableErrorFormatter found: errorFormatter.filtered, errorFormatter.table

Please guide me to resolve this error, here i am using Magento 2.3.4
verions and PHP 7.2.31


texts: Receiving an error and stuck with debugging

texts:
I am kinda stuck with this issue here. I am getting this error code in PHP:

PHP Fatal error:  Call to undefined method Mage_Catalog_Model_Product_Type_Simple::getUsedProducts() in line 23...

Since I am kinda new to Magento I am wondering if somehow this code snippet I got might be wrong or so. Maybe you guys could take a look and let me know if it all seems right. I can't even var_dump the $_products variable.

Here is the code snippet: https://ghostbin.com/paste/n9t23

Thanks in advance!


texts:
I have a form that looks like this:

But I'd like it to look like this (fields side-by-side instead of on top of one another):

How can I do this?

If you're interested in the code, here is an example field in Module/Block/Adminhtml/Sqlreport/Edit/Form.php:

$fieldset->addField("column_description", 'text', array(
    'name'      => 'column_description',
    'label'     => 'Description',
    'class'     => 'sqlreport_column_description',
));


texts:
We have Magento CE 1.9.3.4.

Using Magento Connect, I see we have updates available (up to 1.9.3.7).

When I first started upgrading, I got a whole lot of lines like:

  Package community/Lib_Varien 1.9.2.7 conflicts with:
  community/Mage_Core_Modules 1.9.2.4

I read this answer, which suggests deleting /pkginfo/Mage_All_latest.txt.

I did this, and now the upgrade commences, but the console window keeps repeating the text:

Checking dependencies of packages

Cleaning cache

Checking dependencies of packages

Cleaning cache
..............

I refreshed the page, and tried the upgrade again, and now receive:

Checking dependencies of packages
Already installed: community/Mage_All_Latest 1.9.3.7, skipping
Already installed: community/Interface_Adminhtml_Default 1.9.3.7, skipping
Already installed: community/Interface_Frontend_Default 1.9.3.7, skipping
Already installed: community/Interface_Install_Default 1.9.3.7, skipping
Already installed: community/Mage_Downloader 1.9.3.7, skipping
Already installed: community/Mage_Centinel 1.9.3.7, skipping
Already installed: community/Interface_Frontend_Base_Default 1.9.3.7, skipping
Already installed: community/Phoenix_Moneybookers 1.9.3.7, skipping
Already installed: community/Mage_Compiler 1.9.3.7, skipping
Already installed: community/Magento_Mobile 1.9.3.7, skipping
Already installed: community/Lib_Cm 1.9.3.7, skipping
Already installed: community/Cm_RedisSession 1.9.3.7, skipping
Already installed: community/Interface_Frontend_Rwd_Default 1.9.3.7, skipping
Already installed: community/Mage_Core_Adminhtml 1.9.3.7, skipping
Already installed: community/Mage_Core_Modules 1.9.3.7, skipping
Already installed: community/Lib_Js_Ext 1.9.3.7, skipping
Already installed: community/Lib_LinLibertineFont 2.8.14.13, skipping
Already installed: community/Lib_Js_TinyMCE 3.5.11.12, skipping
Already installed: community/Lib_Varien 1.9.3.7, skipping
Already installed: community/Lib_Google_Checkout 1.9.3.7, skipping
Already installed: community/Lib_Js_Calendar 1.51.1.13, skipping
Already installed: community/Lib_Js_Mage 1.9.3.7, skipping
Already installed: community/Lib_Phpseclib 1.9.3.7, skipping
Already installed: community/Mage_Locale_en_US 1.9.3.7, skipping
Already installed: community/Lib_Mage 1.9.3.7, skipping
Already installed: community/Lib_Magento 1.9.3.7, skipping
Already installed: community/Lib_Credis 1.9.3.7, skipping
Already installed: community/Lib_Pelago 1.9.3.7, skipping
Already installed: community/Lib_Unserialize 1.9.3.7, skipping
Already installed: community/Lib_IDNA2 1.9.3.7, skipping
Already installed: community/Lib_ZF 1.12.10.12, skipping
Already installed: community/Lib_Js_Prototype 1.9.3.7, skipping
Already installed: community/Lib_ZF_Locale 1.12.10.12, skipping

Cleaning cache

Checking dependencies of packages
..............

and this last crop of messages just repeats in a circle.

Help appreciated.


texts:
I have a store whose base currency is EGP, have 2 display currencies: EGP & USD.

I want to make sure that whatever the display currency is, that the checkout is made in USD, since this is the only acceptable currency in PAYPAL & 2CO which i use on my website.

I really need help, need to put my website online asap.


texts: SMTP pro configuration shows blank screen and can't send mail

texts:
When i go to System > Configuration > SMTP Pro it shows me a blank page without any information or errors. It was working great before!

I downloaded the full site, database and imported the theme, in localhost it's working! I have configuration and i can send mails.
I have this problem with other smtp extensions, blank screen or can't send email.
Is it server problem? something is not installed?
Thank you


texts:
I want to include bootstrap and font-awesome for my theme.
Currently I have:
app/design/frontend/[Vendor]/[MyTheme]/.bowerrc

{
    "directory" : "web/bower"
}

app/design/frontend/[Vendor]/[MyTheme]/web/bower/bootstrap/...
app/design/frontend/[Vendor]/[MyTheme]/web/bower/font-awesome/...

Command setup:static-content:deploy not working with this.

I think it's wrong way. How to put the bower correctly?


texts: Magento 2 : Add product category filter in order grid

texts:
In admin I want to add product category filter in order grid so that admin can filter by category
and processed the order.
Please help me guys.
Thanks


texts: Change parent's required JS component type in child component

texts:
I want to extend the JS component: Magento_Checkout/js/view/payment/default.js.
I need to have a custom version of this component which uses an instance of MyCompany_CustomCheckout/js/action/place-order instead of Magento_Checkout/js/action/place-order for placeOrderAction.
How can I do this?
Thanks
............................
The code for the original Magento_Checkout/js/view/payment/default.js is:

define(
    [
        'ko',
        'jquery',
        'uiComponent',
        'Magento_Checkout/js/action/place-order',
        ...
    ],
    function (
        ko,
        $,
        Component,
        placeOrderAction,
        ...
    ) {
        'use strict';

        return Component.extend({
            ... doing something with 'placeOrderAction' ...
        });
    }
);


texts:
How to make an "Update" query in Magento 1.9? I have no Idea how to do it.
I added "filtered" column in catalog_product_entity table.

I have the product I.D and here's my Query.

 $productId = '9';
 $data  = array('filtered'=>0);
 $model = Mage::getModel('catalog/product')->load($productId)->addData($data);
 $model->setId($productId)->save();

And this is the query what i want to achieved.

"UPDATE catalog_product_entity SET filtered = 1 WHERE entity_id = 9".

Note: The column "filtered" is added manually using "ALTER TABLE" in catalog_product_entity.


texts: how i can Get record from sales_order_grid table in Magento 2

texts: i have added a Custom Attribute in sales_order_grid table now I want to get a record from sales_order_grid by entity_id. Is there any model that I can use easily o inject and get sales_order_grid Data in Magento 2


texts: Quantity increment and decrement happening to all products at a time in grouped products

texts:
I Have created quantity increment and decrement for grouped products in this location

C:\xampp\htdocs\Magento2\vendor\magento\module-grouped-product\view\frontend\templates\product\view\type\grouped.phtml

But the problem is if click on quantity increment it applying to all products in the group. It is not coming individually

code
https://drive.google.com/open?id=1aY-ANcC1pL0j1P33ANZFGwXnXMoldkaO


texts:
How can I set the register account page to a 3 column page?
I also want to display two (default) sidebars, left and right.

How can I achieve both?

Thanks


texts: Translating Error Messages on Address Form

texts:
When only entering a few Required Fields when logged in and Adding a new address.

And then submitting that form, the error messages come back in English and not the translated format that is required.

CSV Translation files have been added along with relevant translations for these error messages


texts: Difference between magento 1.9.3.0 and magento 1.9.3.1

texts:
Magento has just released community edition 1.9.3.1.

What's the difference with 1.9.3.0? Only bugfixes from previous release or also other modifications?

Are there any backward-incompatible changes?

Is it also safe to upgrade directly from Magento 1.9.2.4?


texts: Magento 2 product image on product page load slowly

texts: I'm using Magento 2.2.3 with a theme based on luma theme, no change did to the product images gallery. Images have all low size, even so, it takes like 3-4 seconds to load the first image. I have tried the Xumulus extension, but is not really a great choice, as it loads the image first, but delay all the js, so for a few seconds can't do pretty much nothing, like adding to cart.


texts: Magento 2 SHA1 Password is not Accepting after Migration

texts:
I have Migrated Magento 1.9.1.0 website in Magento 2.2.4,all data is migrated successfully.

When I am trying to login from front-end with existing old customer(Magento1)
it generating error

"You did not sign in correctly or your account is temporarily disabled."

While it is working fine for Newly creating customers in Magento 2.

I have debugged in Database customer_entity table and found that old Magento 1 was using SHA1 for password hashing and its length is "40"  + salt = 73 character.Since magento 1 default using MD5 technique but in our Magento code old developers override core file and changed below code

class CD_Core_Model_Encryption extends Mage_Core_Model_Encryption
{
    /**
     * Hash a string
     *
     * @param string $data
     * @return string
     */
    public function hash($data)
    {
        return sha1($data);
    }
}

Hence all passwords in Magento 1 saved in SHA1 format.

passwords are after migrated

6de015050ee16e5451019072f77f2bf50c3c02bc:VLAyPWtkZsHa00UMCWrFNtJ1ARoBp4Wc

Above password are not accepted in Magento 2 when login

Please help anybody how to support SHA1 password in Magento 2.


texts:
When I enable the production mode everything works perfectly.

But when i run this command

php bin / magento setup: upgrade

All static files from pub/static  are automatically deleted (no .htaccess) but They are not regenerated

Consequently the screen appears: Unable to retrieve deployment of static files from the file system.

I always have to generate static files every time!!
There is a solution?

Is a magento 2.2.2 bug.


texts:
I made a e-commerce website using magento 1.9.2.2 (CE) ( currently running on shared hosting ) ( current php version : 5.6 ).

url : https://i-ranu.com

when i checked the website performance on gtmetrix it shows recommendation of serving resources from a consistent url.

herewith provide details what it shows.
The following resources have identical contents, but are served from different URLs. Serve these resources from a consistent URL to save 1 request(s) and 25.1KiB.

https://www.i-ranu.com/media/catalog/product/cache/1/small_image/300x/17f82f742ffe127f42dca9de82fb58b1/d/-/d-138_cruze_lemon_blue.jpg
https://www.i-ranu.com/media/catalog/product/cache/1/thumbnail/300x/17f82f742ffe127f42dca9de82fb58b1/d/-/d-138_cruze_lemon_blue.jpg
The following resources have identical contents, but are served from different URLs. Serve these resources from a consistent URL to save 1 request(s) and 23.0KiB.

https://www.i-ranu.com/media/catalog/product/cache/1/small_image/300x/17f82f742ffe127f42dca9de82fb58b1/d/-/d-147cruzeblue.jpg
https://www.i-ranu.com/media/catalog/product/cache/1/thumbnail/300x/17f82f742ffe127f42dca9de82fb58b1/d/-/d-147cruzeblue.jpg

am unable to figure out how to solve this issue as in this case both images are loaded from single https url but one is small image and other as thumbnail.

can anyone help please how to make it load only one image.


texts: Change Action from Edit to View for product in magento 2 admin panel

texts:
I have different users with different user roles.

I want to change the Edit option to View only for the users who have not added this product.

see attach image

How can I do that?

Allowing Edit to users who have added the product.

The rest can only view it.


texts: Theme installed on local host isn't showing Product images

texts:
I have uploaded the Quick-start package of the theme on my localhost server but when i opened any product details from Manage Products section to make modification there is no option for uploading or adding  of images.
I want to add images to my product.

Please help me to solve this.


texts: Magento2 Hide/show custom category attribute based on category level in admin

texts:
I've created a couple of custom attributes on categories to make it possible for the administrators to create custom menus depending on current category and that works just fine. The thing is that some of those attributes are only relevant for 2nd level categories and some are only relevant for 3rd level categories (and categories deeper in the category tree if there are any).

It makes it very confusing for the administrators if those attributes can be set where they have no effect. So my question is how can I control on which level those attribute inputs will be shown?

None of the attributes are relevant for the RootCategory(1st level) so all inputs should be hidden there.


texts: Reduce the number of stock on shipping (not in order)

texts:
Right now, Magento 2 automatically reduces stock whenever an order is placed. I would like the stock number to be reduced when the product is shipped. How can I change this ? Please suggest.

Thanks.


texts: CMS and Block content warning Magento 2.4.2

texts:
Does anyone have any information or details on the following warning that I am seeing in the 2.4.2 CMS and Block content areas on save?

Temporarily allowed to save HTML value that contains restricted
elements. Allowed HTML tags are: div, a, p, span, em, strong, ul, li,
ol, h5, h4, h3, h2, h1, table, tbody, tr, td, th, tfoot, img, hr,
figure, button, i, u, br, b

It appears to be produced by saving content with html that contains things like data toggles, iFrame embeds, etc.  I've got WYSIWYG turned-off globally, but the warning still gets produced.
I believe it has showed-up after my Magento 2.4.1 - 2.4.2 upgrade, but can't seem to find any information online in regards to the warning, so I'm wondering if anyone has any info here.
A few questions, in-hopes that someone can answer or link to an official doc:
Are data-toggles, iframes and such going to be eliminated in a future release of Magento?
How soon do we have?  Next version?  Magento 2.5?
Will we be able to whitelist some/all of these items for use in admin content areas?
Thanks for any insight or help.
R


texts: How to have first of selected custom options free?

texts:
I'm selling salads on my menu and have a bunch of toppings options (in custom options). Each topping is $0.50, but I'd like to make the first choice free. As in, you get one free topping.

Is this simple to code? or can you point me in the right direction?

Thank you!


texts: URL is not redirecting to homepage in magento

texts:
I have a strange issue with my site. When I Try to load my site with its url, it permanenently redirect to product view page of a particular product in my site. The situation is like this.

Let my site url be www.mydomain.com. When I trying to load this url, it is redirecting to www.mydomain.com/particular-product?crc=110 (an example). The product to which url redirecting seems to be changing in time basis.

I have checked in system -> config and checked in web section.secure url and unsecure url are given correctly there. Then I check home page layout section and made sure that there   is no redirection codes

Then I checked index.php and it also seems good. No redirection codes. I have checked .httaccess. There is however redirection is set to on. But no code found that redirect basic url to any product.

What should I do now.. in order to  load my home page when url is loaded on addressbar. Please help me friends... It makes me crazy.. Thanks in advance


texts:
I have a module that adds a new menu in the backend.
I have the acls defined and they work:

 <acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                    <children>
                        <sub_a translate="title">
                            <title>sub 1</title>
                        </sub_a>
                        <sub_b>
                            <title>sub_b</title>
                        </sub_b>
                       ....
                    </children>
                </module>
            </children>
        </admin>
    </resources>
</acl>

This works.
I also add custom menu options using PHP, depending on conditions (at the location of the dots).
If I add acls for them too, this also works.

But I don't need all this acls! Is there a way to allow all the children of module?
The XML should look something like this:

 <acl>
    <resources>
        <admin>
            <children>
                <module translate="title" module="module">
                    <title>module</title>
                    <sort_order>1000</sort_order>
                </module>
            </children>
        </admin>
    </resources>
</acl>

But all the children should be allowed!

So instead of many checkboxes for the permission configuration, I want a single checkbox.

If I use the second xml, only the topmost menu option is visible in the backend and the whole submenu is hidden.

How can I keep the submenu visible without creating a acl rule for every menu option?


texts: I use use Magento\Framework\Session\SessionManager for save data in session

texts:
This is my code inside myBlock1
    public function regDatiPr(){

    //test read request
    //echo('parametri request
');
    //echo($this->getRequest()->getParam('firstname').'
');
    //echo($this->getRequest()->getParam('lastname').'
');
    //echo($this->getRequest()->getParam('email').'
');

    $emailPr = $this->getRequest()->getParam('email');
    $firstnamePr = $this->getRequest()->getParam('firstname');
    $lastnamePr = $this->getRequest()->getParam('lastname');
    $this->_coreSession->start();
    $this->_coreSession->setEmail($emailPr);
    $this->_coreSession->setFirstName($firstnamePr);
    $this->_coreSession->setLastName($lastnamePr);

    //test read session
    //echo('parametri session
');
    //echo($this->_coreSession->getFirstName().'
');
    //echo($this->_coreSession->getLastName().'
');
    //echo($this->_coreSession->getEmail().'
');
}

The test are all ok.
This is my code inside myBlock2
<?php

namespace vendor\module\Block;

use Magento\Framework\Session\SessionManagerInterface;
use Magento\Framework\View\Element\Template\Context;

class EmailFill extends \Magento\Framework\View\Element\Template {

public function __construct( Context $context,
        SessionManagerInterface $coreSession) {
    $this->_coreSession = $coreSession;
     parent::__construct($context);
}
public function getEmail(){
        $this->_coreSession->start();
    return  $this->_coreSession->getEmail();
}
 public function getName(){
        $this->_coreSession->start();
    return  $this->_coreSession->getFirstName();
}
public function getlastName(){
        $this->_coreSession->start();
    return  $this->_coreSession->getLastName();
}

}

I call magento from a esternal service, the service prepare the  url whit the parameters for myBlock1 untill this point all ok. when call the page whit myBlock2 the data in session are lost, but if I repet teh same operation I just descibed it works like should do.


texts:
I've added <referenceBlock name="header.container" remove="true" /> to my themes default.xml and instead has been replaced with:
<referenceContainer name="page.wrapper">
    <block  class="Magento\Framework\View\Element\Template"
            name="top.header"
            template="Magento_Theme::html/custom_header.phtml"
            before="header.container"
    />
</referenceContainer>

But, by doing this I lose all of the minicart functionality. The JS is not added. This is a problem for me because when I attempt to get the cart total like so:

I get an error:
console-output-handler.js:34 [2020-11-12 10:34:54] [ERROR] Failed to load the
"Magento_Checkout/js/view/minicart" component.

But if I make the header.container visible with <referenceBlock name="header.container" remove="false" /> my custom header shows the cart quantity total ... except I now have two headers showing (the default one and my custom).
I've battled with this for hours to no avail. What am I missing?


texts: Checkout with papal redirecting issue from weltpixel quickview popup

texts:
I am using the Weltpixel theme in that there is a module quick view, it is the quick view popup and there is a button PayPal checkout.
When we clicking on the PayPal button it should add the product to the cart and it should redirect to the PayPal website. But the redirecting is not happening.
Please can someone help me to fix this issue?


texts:
I'm new to Magento and not a *nix pro, so I hope I'm just making a rookie mistake here. My setup...

Magento 2.1.4 CE
CentOS 7-3.1611
nginx 1.12.0 (SSL termination only)
Varnish 4.1.0
Apache 2.4.25
PHP 7.0.15
MySQL 5.7.17

Everything seems to work fine with http (non-SSL), but I need to use https for all pages.

When I enable https, everything seems to work fine except the CHECKOUT PAGE IS EMPTY (i.e., the "GET /checkout/" request returns "200 OK" but "Content-Length: 0"). There are no messages in the browser console. I'll mention that I'm using a self-signed certificate for development, but it seems to work okay.

If I go to the cart page (/checkout/cart/) first, I get errors in the browser console (which do NOT occur in non-SSL)...

...
VM27901:3 Uncaught TypeError: Cannot read property 'length' of null
    at visible (eval at createBindingsStringEvaluator (knockout.js:2624), <anonymous>:3:83)
    at update (knockout.js:4558)
    at ko.dependentObservable.disposeWhenNodeIsRemoved (knockout.js:3004)
    at evaluateImmediate (knockout.js:1737)
    at ko.subscription.evaluatePossiblyAsync [as callback] (knockout.js:1677)
    at Function.notifySubscribers (knockout.js:1103)
    at Function.observable.valueHasMutated (knockout.js:1300)
    at observable (knockout.js:1285)
    at Object.setShippingRates (shipping-service.js:22)
    at Object.<anonymous> (new-address.js:60)
visible @ VM27901:3
update @ knockout.js:4558
ko.dependentObservable.disposeWhenNodeIsRemoved @ knockout.js:3004
evaluateImmediate @ knockout.js:1737
evaluatePossiblyAsync @ knockout.js:1677
notifySubscribers @ knockout.js:1103
observable.valueHasMutated @ knockout.js:1300
observable @ knockout.js:1285
setShippingRates @ shipping-service.js:22
(anonymous) @ new-address.js:60
fire @ jquery.js:3099
fireWith @ jquery.js:3211
done @ jquery.js:9310
callback @ jquery.js:9720
...

There are a few more messages (which I can include if they'll be helpful), but the above seems to be the relevant section.

Can anyone help me? I'm going bananas with this.

Thanks,
Scott B.


texts: Bannerslider module "Incorrect dependency in class" error

texts:
I am working on a Magento 2.1.7 shop. To achieve this, I have created a child-theme of Magento Blank.

I have installed the Bannerslider module.

I run the commands:

php bin/magento module:enable Magestore_Bannerslider
php bin/magento setup:upgrade
php bin/magento setup:di:compile

All was ok in my local development environment, but on staging environment I get an error Incorrect dependency in class Magestore\Bannerslider\Controller\Index in /var/www/staging.domain.com/app/code/Magestore/Bannerslider/Controller/Index.php
\Magento\Framework\ObjectManagerInterface already exists in context object in the console.

Also, Error log record number: 1455276823131 error in the browser (frontend).

Why is that? What is the fix? Thank you!


texts: Magento 2.2.7 - Notice: Undefined index: magento2_product_1_v2648

texts:
When running indexing I am getting an error
bin/magento indexer:reindex catalogsearch_fulltext
Catalog Search indexer process unknown error:
Notice: Undefined index: magento2_product_1_v2648 in
/vendor/magento/module-elasticsearch/Elasticsearch5/Model/Client/Elasticsearch.php on line 171


texts: Magento : How To Remove Simple Product From Quote in Observer

texts:
I am using this event: sales_quote_save_after
This is my function code:

public function myFunction(Varien_Event_Observer $o){
    $quote = $o->getEvent()->getQuote();
}

I have simple products and bundle products. I would like to remove only simple products. How can I do that?

Thx


texts: Removing list of products from up-sells items

texts:
I need to remove a list of products from all the up-sells lists; so what I'm doing is checking the IDs of the up-sells products for each product in the database and ideally remove the IDs of the products I don't need anymore and save it.

How can I update the upsells product list or just remove the item I don't want (having its ID)?

Just to avoid some misunderstanding of the problem, below part of the code I wrote:

foreach($collection as $p) {
   $upsell = $p->getUpSellProductIds();

   if ( count($upsell) > 0 ) {

      foreach ($upsell as $k => $u) {

         // Check if the entity_id is among the discontinued products
         if ( isset($discontinued[ $u ]) ) {
            // TODO : Remove the discontinued entity from the upsells list
         }
      }
   }
}


texts: How do you use the API to add products to a bundle?

texts:
I'm developing a system that integrates an existing Django application with a Magento store. I've managed, using this library, to create bundle-type products, along with attributes and categories as expected. The problem is that I can't find a way, using the API (either through the aforementioned library or calling the xmlrpc methods directly), to add products to a previously created bundle. Calling the catalog_product.info method doesn't return anything useful about the bundled objects.

Researching online, I've only found solutions that involve either:

PHP scripts that use the Magento code base
Straight-to-database insertion

Neither of these is currently an option for me right now, and I don't think being able to do this by using just the API (either REST or SOAP) isn't an irrealistic expectation to have.


texts: Magento2: Re generate css file in pub/static folder

texts:
I have installed Magento 2 and set developer mode, then I have installed one module that contains css and js files. The module works fine and css and js files are rendering from pub/static folder. Now I have made css changes in module directory css file and run command

php bin/magento setup:static-content:deploy

but Magento is not making my new changes in pub/static css files so I'm getting old css file contents.
Does anyone know how to regenerate the whole css file in pub/static folder?


texts: A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later

texts: I have set min query length in catalog search to 3.And if search less than this characters then i get this above error. I have used mageplaza extentions. I tried with disable also.But same issue remains. Is there any other issue for this.


texts: how to get data in _afterSave function in model

texts:
I am creating a custom model and rewriting the sales/order_status model and create the function

public function _afterSave(Mage_Core_Model_Abstract $object){

    echo "here"; exit;
}

this function is executing perfectly but i want to get data. how can I achieve this task?


texts: Reasons for Magento redirecting to an install page

texts:
I have cloned a git repository containing a magento site in the same way as I normally do when joining a project. I went through the usual process of setting up database and setting everything up on my local.

This time for some reason everytime I try to view the site through my browser it redirects to the magento install page. I have only set up a few magento sites in the past and none were from scratch but I assume due to not having to install it before, I shouldn't have to this time. Any ideas what may be wrong or what file I need to modify to get this to work?


texts: Community extensions not showing in Magento Connect Manager after 1.9x upgrade

texts:
I have upgraded a magento website from 1.7x to 1.9x. I found many issues but one of them is pretty serious.
I have copied the app/code/community folder from the old to the latest version.
Now the problem is I cannot see those extension on my Magento Connect Manager. Neither I can install those extensions nor I can update those.

Please guide me as to what is the best way to get the extensions show up? What is the best way to upgrade infact.


texts: Magento Multiwebsite shared login and logged in while switching

texts:
I'm trying to share customer b/w two magento website with one backend, so here is my scenario,

Main website is www.abc.com & the second website is pro.abc.com, If a customer logged in site A he should be logged in Site B if he switch site.

Share login details on multiple websites in Magento i have tried this method but didn't work at all for me.

Any help would be appreciated.


texts: How to call function on configurable product?

texts:
I have a dropdown on product detail page.

No of Window

  <select class="swatch-select no_of_window">
    <option value="0" option-id="0">Choose an Option...</option>
    <option value="227" option-id="227">1</option>
    <option value="228" option-id="228">2</option>
 </select>

I tried,

require(['jquery'],function($){

$(document).ready(function(){

   $( "select.no_of_window" ).change(function() {
      alert( "Handler for  called change." );
    });
});

});

Event is not getting called?


texts: Magento 1 end of life on Nov. 2018 or not?

texts:
Please see this answer by an internal staff of Magento who states that:

  Magento 1.x end of life is November 2018.

However on their official blog, this post states:

  Magento 1 has been and will continue to be supported for the
  foreseeable future.

  ...

  Lastly, we are committing to a minimum 18-month notice before we make
  any changes to our support levels.

I'm now confused. Ben says end of life is Nov. 2018 but I haven't received any 18-month notice of support level changes as of now, so according to the official news, it shouldn't be end of life in Nov. 2018 yet.

We have invested much in the themes and extensions of our Magento 1 store.

Magento 2 is awesome but since everything's working great, we hate to do everything (design, functions, user exp, tests, optimizations, etc.) over again as stuff are completely incompatible between the two versions.

The only concern is security.

So is Magento 1 going end of life and not supported beyond Nov. 2018 or not?


texts:
Magento 1.8 is painfully slow on my wamp localhost.

I have increased the memory in php.ini, following this answer,

max_execution_time = 1800
memory_limit = 512M

But it is still very very slow.

Anything else can I do?


texts:
Originally, the images in my theme had imagezoom on hover. However, this made it impossible to scroll over images when viewing the page on mobile phone - you just ended up zooming instead. Because of that, I decided to hide the imagezoom container from images.

However, I still can't scroll when hitting the main image of a product in mobile view. Can someone please help me figure out why?

Example: http://tiny.cc/79r92x
Video of the scroll problem: https://youtu.be/wzWshmPIhiE

I have spoken to my theme developer, but they don't acknowledge the problem.


texts: Create QR codes per single product purchased

texts:
Hello to the community!

I have the necessity to create QR codes per every single product that's purchased.
I know that there's a way to link a SKU to a QR code, but what I need to do is a little more complicated.

Let's say that user X buys 3 units of SKU A, 2 units of SKU B and 1 unit of SKU C.

What I'll need is a total of 6 QR codes:
 - 3 QR codes for SKU A (because the user X bought 3 units of the same product)
 - 2 QR codes for SKU B (because the user X bought 2 units of the same product)
 - 1 QR code for SKU C (because the user X bought a single unit of this product).

This, of course, means that I would generate the QR codes after the payment has been finalised.

Any ideas?

Thanks in advance!

LDR


texts: Move custom product in More Information Tab

texts:
I want to move product attributes inside the more Information tab.

Can someone help?


texts: After Magento upgrade from 1.4 to 1.8 - "Recoverable Errors"

texts:
I'm seeing a lot of "Recoverable Errors" in my system.log file after an upgrade from 1.4 to 1.8. For example:

  2014-09-17T21:57:08+00:00 ERR (3): Recoverable Error: Argument 1
  passed to Mage_Core_Model_Resource_Db_Abstract::load() must be an
  instance of Mage_Core_Model_Abstract, array given, called in
  /chroot/home/site/site.com/html/ecc/Desktop.php on line 61 and defined
  in
  /chroot/home/site/site.com/html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php
  on line 371

  2014-09-17T21:57:08+00:00 ERR (3): Recoverable Error: Argument 1
  passed to Mage_Core_Model_Resource_Db_Abstract::unserializeFields()
  must be an instance of Mage_Core_Model_Abstract, array given, called
  in
  /chroot/home/site/site.com/html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php
  on line 387 and defined  in
  /chroot/home/site/site.com/html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php
  on line 546

  2014-09-17T21:57:08+00:00 ERR (3): Recoverable Error: Argument 1
  passed to Mage_Core_Model_Resource_Db_Abstract::_afterLoad() must be
  an instance of Mage_Core_Model_Abstract, array given, called in
  /chroot/home/site/site.com/html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php
  on line 388 and defined  in
  /chroot/home/site/site.com/html/app/code/core/Mage/Core/Model/Resource/Db/Abstract.php
  on line 697

Any thoughts? Thanks!


texts: Where to add Mailchimp Subscriber Popup code in magento

texts:
I apologize if this question has been posted before, but I checked all over google and could not find anything.

I am trying to add the Mailchimp subscriber popup to my homepage, but cannot figure out where to place the code. The following code is provided by Mailchimp:

<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/signup-forms/popup/embed.js" data-dojo-config="usePlainJson: true, isDebug: false"></script><script type="text/javascript">require(["mojo/signup-forms/Loader"], function(L) { L.start({"baseUrl":"mc.us13.list-manage.com","uuid":"5a1a0fd7515829aea469xxxxx","lid":"3ce6dxxxxx"}) })</script>

The problem I am having with this code is that anywhere I place it, it will not display in the frontend. I have tried adding the code to template/page/html/head.phtml, tried adding it directly to the content section of the homepage cms page, tried adding the code in the page layout section for the homepage cms page using a xml reference block i found in another post, and i have tried to add the code under system/configuration/general/design/HTML Head in Miscellaneous Scripts.

However, I have not had any success at all. It is my understanding that the popup should be displayed after refreshing the homepage. If i use developer tools in google chrome, i can see the above code in the head section, but it is not doing anything.

I am using magento version 1.9.2.1

Thank you for your help.


texts: Programmatically remove attribute from attribute-set

texts:
I've tried removing an eav_entity_attribute using this code:

$entAttr = Mage::getModel('eav/entity_attribute')->getCollection()
        ->addFieldToFilter('attribute_set_id',$set->getId())
        ->addFieldToFilter('attribute_id',$attId)->getFirstItem();

    $entAttr->delete();

but it doesn't work. I receive this error:
Column not found: 1054 Unknown column 'attribute_set_id' in 'where clause''

How can I delete an eav_entity_attribute this way?


texts:
I want to have one functionality similar as related products.
See https://prnt.sc/t5dxzl
I will add Related products in backend and i want to add Add to cart functionality to it.
Remember i want to keep default related products functionality also and this also.
how can i do that?
Is there any code / module or free extension available for this.


texts: Mage/Core/Model/Translate.php creates warning in log

texts:
my log is filled up with this warnings:

2016-04-18T07:13:09+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:28+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:28+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:28+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:28+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:42+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:42+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:42+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:42+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:42+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:58+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569
2016-04-18T07:15:58+00:00 ERR (3): Warning: array_key_exists(): The first argument should be either a string or an integer  in /html/magento/app/code/core/Mage/Core/Model/Translate.php on line 569

How can I find the file which calls this function, to solve this warning?


texts: what is the code for table rates shipping method & cash on delivery" payment method

texts:
I am using this shipping "Table rates" and "webshopapp matrix rates" shipping methods.

what i need is that , if  we use table rates shipping method, i want to hide "cash on delivery" payment method.

i am following this link : https://stackoverflow.com/questions/26604267/magento-onepage-checkout-hide-payment-method-depending-on-shipping-method

please help me to find what is the code for

1)table rates shipping method

2)cash on delivery" payment method....


texts: json data returns default price instead of store price

texts:
I'm trying to get the price in my custom module index controller like this:

$result['price'] = Mage::helper('core')->getStore()->currencyByStore($product->getPrice(), $store_id, true, false);

But it returns the base store price, not the right price. The currency is right though.

Even if I use it like this (my other store has an id of 2) it returns the base price:

$result['price'] = Mage::helper('core')->getStore()->currencyByStore($product->getPrice(), 2, true, false);

Even if I do this:

$product->setStoreId($store_id)->getPrice()

json returns the base price.

Any ideas?

Thanks!


texts: Add a javascript to any cms page magento

texts:
I would really like to use this on a single cms page in magento. For some reason it will not show the content.

page with script

<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script type="text/javascript">// <![CDATA[
mediaid=191156;subid='';entry=25;provider='0';duration=0;renewal=0;daisyconTelecomFilterView=1;col='1111111';programs='all';header='FFFFFF';background_price='E2F0FB';border='ECECEC';button_text='Bekijken';button_color='FF8300';button_hover='FF9E3D';button_textcolor='FFFFFF';font='Arial';slider='3694C7';minMob='0';maxMob='1000';minMin='100';maxMin='3000';minInt='200';maxInt='6000';minAb='0';maxAb='100';mobiles='all';
// ]]></script>
<script type="text/javascript" src="http://developers.affiliateprogramma.eu/mobielvergelijker/general.js"></script>
<script type="text/javascript" src="http://developers.affiliateprogramma.eu/mobielvergelijker/jquery.nouislider.min.js"></script>


texts:
I would like to use addFieldToFilter (or other...) in a collection to make this filter :

  (item1 = 'value' AND (item2 = 'value1' OR item = 'value2')) OR (item2 = 'value3' OR item = 'value4')


texts: Custom magento 2 theme not showing up up on content/design/configuration

texts:
I have been trying for two day to figure out how I can customize my magento template. Recently I have become stuck on being able to  pull up my new magento theme in the backend admin panel. I have followed the the dev docs to the tee, at least I think so, but I still cannot figure out what I am doing wrong.
Here are the files
Registration.php:
<?php

\Magento\Framework\Component\ComponentRegistrar::register(
\Magento\Framework\Component\ComponentRegistrar::THEME,
'frontend/shayan/uub',
__DIR__
);

theme.xml:
<!--

    <theme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Config/etc/theme.xsd">
    <title>Magento uub</title>
    <parent>boxstore/boxstore_default</parent>
    <media>
        <preview_image>media/preview.jpg</preview_image>
    </media>
</theme>

composer.json:
    {
       "name": "shayan/theme-frontend-uub",
    "description": "N/A",
    "require": {
        "php": "~5.5.0|~5.6.0|~7.0.0",
        "magento/theme-frontend-blank": "100.0.*",
        "magento/framework": "100.0.*"
    },
    "type": "magento2-theme",
    "version": "100.0.1",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [
            "registration.php"
        ]
    }
   }

I have already tried
php cache:clear php
php bin/magento setup:upgrade
php bin/magento setup:static-content:deploy


texts: Magento 2 How to check on front-end side if admin is logged-in or not

texts:
The below code works in Magento 1.

Mage::getSingleton('core/session', array('name' => 'adminhtml'));
$adminSession = Mage::getSingleton('admin/session');
if ($adminSession->isLoggedIn()) {
  $adminIpAddress = $adminSession['_session_validator_data']['remote_addr'];
}

I am trying below code in magento 2 that is working in admin section but not working on front end

 $adminSession= $this->auth->isLoggedIn();
    including (\Magento\Backend\Model\Auth)

I need to check if admin is logged in or not on front end in magento2

Any help will be appreciated.


texts: Register administrator who creates a backend sales order Magento 2

texts: I'm new to magento 2. I need to know the name of the administrator account who created an order for the backend. Is Magento currently registering or is development necessary?


texts: Magento 2: Create REST POST webapi to read uploaded xml

texts: I need quick help related to creating a POST web API which will accept XML(Multipart/form-data) and read the uploaded XML.


texts: Error while running bin/magento setup:di:compile

texts:
After running bin/magento setup:di:compile I get the following error.

Errors during compilation:

  Vendor\Module\Ui\Component\DataProvider\OutfitProvider      Incompatible
  argument type: Required type: string. Actual type:
  \Allure\Celebrities\Ui\Component\DataProvider\name; File:
  /var/www/vhosts/phoenix/app/code/Vendor/Module/Ui/Component/DataProvider/OutfitProvider.php

Here is the code on Ui listing

<dataSource name="outfit_listing_data_source">
    <argument name="dataProvider" xsi:type="configurableObject">
        <argument name="class" xsi:type="string">Vendor\Module\Ui\Component\DataProvider\OutfitProvider</argument>
        <argument name="name" xsi:type="string">outfit_listing_data_source</argument>
        <argument name="primaryFieldName" xsi:type="string">celebrity_outfit_id</argument>
        <argument name="requestFieldName" xsi:type="string">id</argument>
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="update_url" xsi:type="url" path="mui/index/render"/>
            </item>
        </argument>
    </argument>
    <argument name="data" xsi:type="array">
        <item name="js_config" xsi:type="array">
            <item name="component" xsi:type="string">Magento_Ui/js/grid/provider</item>
        </item>
    </argument>
</dataSource>

Class

        use Magento\Ui\DataProvider\AbstractDataProvider;
        use Magento\Framework\App\Request\Http;
        use Vendor\Module\Model\ResourceModel\Outfit\CollectionFactory as OutfitCollectionFactory;
        use Magento\Framework\Session\SessionManagerInterface;
        use Magento\Framework\View\Element\UiComponent\DataProvider\DataProviderInterface;

        class OutfitProvider extends AbstractDataProvider implements DataProviderInterface
        {

            protected $_outfitCollection;

            protected $_request;

            protected $_sessionManger;

            public function __construct(
                $name,
                $primaryFieldName,
                $requestFieldName,
                array $meta = [],
                array $data = [],
                OutfitCollectionFactory $outfitCollection,
                Http $request,
                SessionManagerInterface $sessionManager
            ) {
                parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
                $this->_request = $request;
                $this->_sessionManger = $sessionManager;
                $this->_outfitCollection = $outfitCollection;
                $this->initCollection();
            }

            public function initCollection()
            {
                $id = $this->_request->getParam("id");
                if(isset($id))
                {
                    $this->_sessionManger->setCelebrityId($id);
                }
                $collection = $this->_outfitCollection->create();
                $this->collection = $collection;
                $this->collection->addFieldToFilter("celebrity_id", array("eq" => $this->_sessionManger->getCelebrityId()));
            }

        }


texts: Add product stock information to product repository

texts:
When working with the ProductRepository in Magento 2 and the results of the getList method what is the "best" way to add extra information to the results?

For example in the default 2.1.7 setup you will get the following data.

Array
(
    [entity_id] => 1
    [attribute_set_id] => 4
    [type_id] => simple
    [sku] => sample-product-1
    [has_options] => 0
    [required_options] => 0
    [created_at] => 2017-06-06 11:28:00
    [updated_at] => 2017-06-06 11:28:00
    [status] => 1
    [visibility] => 4
    [name] => Sample Product 1
    [meta_title] => Sample Product 1
    [meta_description] => Sample Product 1
    [options_container] => container2
    [url_key] => sample-product-1
    [gift_message_available] => 2
    [meta_keyword] => Sample Product 1
    [price] => 2.3000
    [quantity_and_stock_status] => 1
    [tax_class_id] => 2
)

But how would you recommend retrieving the stock quantity information ?


texts: product name with brand, first level, second level and third level catagory list

texts:
Hi I want to get list of all the sku along with its brand and its first level ,second and third level category...
eg

fashion, topwear, jacket, denim, blue jacket(name), levis.


texts: In Magento2 file_get_contents any library

texts: i am using file_get_contents in magento2 is there any framework or core function for this already in magento2?


texts: 2.3.0 Watermarks not showing on product images

texts:
Watermarks are not showing up on product images in v2.3.0.

Steps to reproduce

Create categories
Create products
Modify buggy image uploader to work around bug so you actually can upload an image.
Upload a watermark (use watermark in this issue  as a watermark example)
set image opacity to 10, image size to 40x50, image position to tile, and saved configuration.
tap the Cache Management link in the system message. Then, refresh the invalid cache.

2.3.0 Docs state:

Complete the Base, Thumbnail, Small, and Swatch Image image settings as follows. The fields in each section are the same.

Enter the Image Opacity as a percentage. For example: 40
Enter the Image Size, in pixels. For example: 200 x 200
Tap Upload, and choose the image file that you want to use.
Set Image Position to determine where the watermark appears.
When complete, tap Save Config .
When prompted to refresh the cache, tap the Cache Management link in the system message. Then, refresh the invalid cache. Even tried to clear all available clear catch options inside cache management.

....still no watermark on product images.

2.3.0 Installation
No third party modules
No errors in browser console, or magento logs.

Opened ticket
And posted in forum

Other users with similar problem but some on older than 2.3:
here, here, here, here

How do you resolve this?


texts: What is the best way to setup SSL certificates on a Multi Store installation?

texts:
We currently have a client who has a multi store setup (3 websites) with 3 different URLS (.com,.fr,.ie). Each URL needed an SSL certificate and since an SSL certificate is bound to one IP we had to create several accounts on WHM and do some cpanel trickery (not ideal) to get the .fr and .ie to point to the .com directory while having an SSL associated with it.

This works for us but I am convinced there is a better way of doing this and I was wondering if the Magento community could enlighten me?


texts: I need to write a cron job which will import stock levels every 15 minutes from a wholesaler using SKU numbers as the unique identifier.  My previous shopping cart had a table containing both the qty and sku fields which made life easy as there was just one table to refer to in the code, but obviously Magento doesn't have this.  Can anyone offer any advice please?  My head is literally spinning now as I have read so much stuff and am becoming confused.  Thank you in advance


texts:
I try to implement a quotation form.
I then created a new module with a phtml file containing the form (with several input / input-select) and the price calculation result.

Now I would like the form to be "dynamic", i.e. that the price is updated each time a parameter (input) is changed and not to have to click on a button to submit manually the form.

I have been told that to avoid a full reload of the page each time a value is changed I had to use Ajax request? Could you confirm please?

How may I implement that?

Thank you for your help,


texts: What will be the Id of the orders from LastRealOrder and LoadByIncrementId

texts:
I wanted to know what will be the output of the following.

$LastorderId = $this->_checkoutSession->getLastRealOrder()->getIncrementId();

$orderId = $this->_orderFactory->create()->loadByIncrementId($LastOrderId)->getIncrementId();

if the $LastorderId I get is 000000016. What will be $orderId ?


texts: How to customize homepage change the background color and add product to home page in magento community


texts:
I have a product with an upload file custom option. The accepted file is an image. After the image is uploaded, i have a javascript function that edits the image and generates a base64 string image. The issue now is I do not want magento to add the originally uploaded image to the cart, but the new base64 string image. I've tried manipulating the original uploaded file using javascript but the file api is not mutable in any way. So how can I make it so magento adds this altered image instead of the original one?

Any help is appreciated, Thanks!!


texts:
Condition in xml file catalog.xml

 <xsl:if product="bundle" >
   <block type="catalog/product_view" name="product.clone_prices" as="prices" template="catalog/product/view/price_clone.phtml"/>
 </xsl:if>

Doesn't come with the prices in bundled product. Please suggest if the systax is right or other alternative suggestion


texts: Uploaded Image doesn't show as base image in frontend and thumbnail at backend (Magento 2.2.3)

texts:
Suddenly I'm having an issue regarding uploaded images. They are on the backend (Images And Videos ) but does not show as a base in frontend and thumbnail at the backend. After uploading an image also, the "upload" option goes missing and I just see a loading gif beside the uploaded image. I've attached images. Do you guys know why it's happening? Could be server issues?

UPDATE: I noticed i got this error "A technical problem with the server created an error. Try again to continue what you were doing. If the problem persists, try again later." after saving


texts: Is it possible to rename a country that appears in the select menu when adding an address? I'd like to rename United Kingdom to UK Mainland.


texts: How to programmatically access information entered in the Admin panel?

texts:
I’m new to Magento, and beginning to understand how it works, but I’m a bit unclear as to how to find the right “get...” and “set...” methods to access data (particularly from the Admin pages) and understanding how/where Magento is finding these methods.

For example, I want to put jQuery and other scripts in the HTML Head section.  My intuition is to put it in the “Miscellaneous Scripts” section of the System>>Config>>Web>>HTML Head section.

I check out head.phtml and find

<?php echo $this->getCssJsHtml() ?>
<?php echo $this->getChildHtml() ?>
<?php echo $this->helper('core/js')->getTranslatorScript() ?>
<?php echo $this->getIncludes() ?>

which leads me to Head.php, where it looks like the method that’s getting the “Miscellaneous Scripts” is getCssJsHtml.

However, I’m not sure, and in general I’m wondering how to find what these methods do and how they related to the Magento files and Admin GUI?

Thanks very much!


texts: Can't get rid of calendar-win2k-1.css via layout xml updates

texts:
I am trying to get rid of a css file, which constantly is being loaded but I don't use dates anywhere in the frontend. It seems I can't erase this file no matter what but it blocks my rendering on each site...

Yes, I could just delete the code of the css file but my browser would still make one extra request to load the blank file.

/js/calendar/calendar-win2k-1.css

I tried editing the local.xml of my own theme to remove this file:

<layout>
  <default>
    <reference name="head">
       <action method="removeItem"><type>js_css</type><name>calendar/calendar-win2k-1.css</name></action>
     </reference>
  </default>
</layout>

But that does not change a thing. Then I saw the same problem with a possible solution and tried to copy it:

I tried Rajeev's approach to create a module and remove the file in an own custom layout update, however even though my module and custom layout update work (I have succesfully tried adding other example files in the head with my module), the file won't disappear.


texts: Are the Magento 2.1.14 rewrite rules in htaccess file working properly?

texts:
In the default htaccess file in Magento 2.1 there are some RewriteCond's and RewriteRule's that are explained in the htaccess.sample file that comes with Magento 2.1.

never rewrite for existing files, directories and links

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

rewrite everything else to index.php

RewriteRule .* index.php [L]

When I typed my domain name with a random file name or directory into the web address bar of my browser it throws a 404 page with the unfound url still in the adress bar of the browser.  I don't consider this undesirable and actually do not mind this (for SEO purposes), but given that the RewriteRule line is supposed to "rewrite everything else to index.php" is this correct behavior?  Do I still need this RewriteRule?


texts:
Fatal error: Class 'Magehit_FeaturedProducts_Helper_Data' not found in

D:\wamp\www\magento_test\app\Mage.php on line 547.


texts: Magento 2: what are the Interceptors file in var/generation?

texts:
So I noticed some Interceptor.php files in var/generation

I know that this folder contains generated classes created on the fly for the following:

Factories
Proxies
Plugins

I assume that Interceptor files are linked to the plugin ones however sometimes I don't get how those files are generated. For example I've got var/generation/Magento/Framework/App/Response/Http/Interceptor.php but this file don't seem to match any existing class.

So I'm looking for a well explained workflow on how Interceptor.php files are generated ?


texts: magento default zoom function not working on initial page load

texts: I'm running magento ce 1.9.1 and, on initial page load, the zoom function is not working until either a thumbnail is clicked or the browser window is resized. The only difference I can see is that the zoom container is not present initially. Please see my demo page at https://streetmatsuri.com/index.php/gen-2-0/nrg-quick-release-gen-3-0.html Any help would be appreciated; thanks in advance.


texts: Boolean attributes not displaying any options when used as part of conditions or actions in a promo rule

texts:
I've got a couple of boolean custom attributes which I'm having an issue using in cart or catalog price rules. These attributes appear correctly on the product edit pages and can be used successfully for criteria in advanced search. The problem occurs when trying to use these attributes as part of promo rules. The attributes show up properly as options to be used for conditions or actions, but when selected, the drop-down is empty and does not let me pick if the attribute should be true/false:

This is the setup for one of the attributes in the admin section:

and the code used to generate the attribute:

    $eavSetup->addAttribute(
        \Magento\Catalog\Model\Product::ENTITY,
        'gtr',
        [
            'type' => 'int',
            'backend' => '',
            'frontend' => '',
            'label' => 'Guaranteed to Run',
            'input' => 'boolean',
            'class' => '',
            'source' => '',
            'global' => \Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface::SCOPE_GLOBAL,
            'visible' => true,
            'required' => false,
            'user_defined' => false,
            'default' => '',
            'searchable' => true,
            'filterable' => false,
            'comparable' => false,
            'configurable' => false,
            'visible_on_front' => false,
            'used_in_product_listing' => false,
            'unique' => false,
            'apply_to' => '',
            'is_used_for_promo_rules' => true,
            'is_used_for_price_rules' => true
        ]
    );

Can anyone lend any insight into why this is happening?


texts: Migrate Critical Magento Database Tables

texts:
My client has a production server running CE 1.7.0.2. I am developing a new version of the site on CE 1.8.1.0. The new site includes a new theme, and shedding loads of the old modules and extensions.

Once the new site is ready, I'll want to transfer all the orders, customers, consignments, products, categories, etc. to the new site.

I DON'T want the data from the redundant modules, or the config stuff. Finally, my question; what's the best way to achieve this.

I have in mind to copy all the "critical" tables across, leaving out the core_config_data, core_store, etc. tables. Is this possible or am I dreaming? Thanks for your input.


texts: I am using aloquick theme. I would like to remove tax from cart. How can I do that ?


texts: Magento 1.14 custom skin not applied to products

texts:
I created a custom design skin and assigned it to some categories under Manage Categories/Custom Design tab, and selected Yes to Apply To Products.  This works fine if the user drills down through the category, series(sub-category), then to the product page from the product listings.

Where it doesn't work is when the product appears on the right column under 'Recently Viewed Products' and is clicked from there.

The difference appears to have something to do with the URL format or breadcrumbs.  From the series page, then products URLs are hierarchical as domain/category/series/product and the skin is applied correctly.

When the links appear as recently viewed they are just as domain/product.  It's when the page displays like this (and missing the category/series breadcrumbs) that it breaks by show the default skin even though the product belongs to the category with the custom skin.

So I'm not sure if this is a skin bug or a breadcrumb bug, but the crumbs look the same in Magento2.   I don't care about how the breadcrumbs show, I just need the custom skin applied to the product based on its owner category.   Any ideas?


texts: How To Exclude Free Shipping for Specific States In Magento 2.3?

texts:
how to off free shipping for specific states.
Example:
I have free shipping for all items over item total $100.
I do not want to have free shipping for USA state of Hawaii, Alaska.
Please advice.
Thank you,


texts: Magento 2: Override js in custom module doesn't work?

texts:
I'm trying to override js in custom module, but that module which i want to override is already override some js from magento_checkout.

And seem like it doesn't work :(

Here is how i did:

That module is override from magento_checkout:

Alright, so i did this before and its work, but for some reason, i fixed it, and now it doesn't work anymore, and i can't find the way to fix this back to work :(
EDIT 1:

  di.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <preference for="Amasty\Deliverydate\Block\Checkout\LayoutProcessor" type="Gssi\Deliverydate\Block\Checkout\LayoutProcessor"/>

    <!-- TAIG-8 #2: add "PO #" field in "BuyersOrderNumber" -->
    <preference for="Amasty\Deliverydate\Plugin\Checkout\ShippingInformationManagement" type="Gssi\Deliverydate\Plugin\Checkout\ShippingInformationManagement"/>
</config>

Please help, thanks


texts: Magento 2 : Make Wish-list functionality without Login (Guest Wish-list)

texts: I want to make a customization to add wishlist for guest, no need to install separately extension.


texts: How to get real IP from behind Sucuri firewall

texts:
I have a Magento store on an Ngix behind Sucuri firewall and we hide prices if the IP is outside of UK.
A bruteforce attack was bypassing the firewall so the hosting added the following rules to prevent bypass:

     location / {
            allow 192.88.134.0/23;
           allow 185.93.228.0/22;
          allow 2a02:fe80::/29;
          allow 66.248.200.0/22;
          deny all;
           # Existing NGINX rules
            }

This works fine except that all IPs are transalted as the firewall one based in UK. To get the real IP Sucuri suggested to add the following:

  # Define header with original client IP
  real_ip_header X-Forwarded-For;
  # Define trusted Firewall IPs
  set_real_ip_from 192.88.134.0/23;
  set_real_ip_from 185.93.228.0/22;
  set_real_ip_from 66.248.200.0/22;
   set_real_ip_from 2a02:fe80::/29; # this line can be removed if IPv6 is
  disabled

This second rule causes a problem. Once the IP is translated and if it is different than the allowed Sucuri IP addresses, the requests is restricted with 403 Forbidden error.

Is it impossible to have the store behind a firewall and still get the real IP. I am sure that this is not the only store in the world behind a firewall, which needs to server different content depending on the IP.
The code in  Magento that gets the IP of the client is something like this:

        $geoIP = Mage::getSingleton('geoip/country');

        if ($geoIP->isCountryAllowed()) {....

Any alternative? SOlution? My hosting provider is useless..


texts: How to run google business API using account id and location id

texts:
I have an account id and location id, how to run the following script in Magento 2
<?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
?>

I want to share these review details into my custom phtml file, what is the best approach to achieve this?


texts: Loading external JS using requireJS in Magento2

texts:
Following this answer I try to add an external JS file named Pym.js to my Magento 2.3 shop.

I've tried several things but can not get it to work. My current setup it:

  app/design/frontend/vendor/theme/requirejs-config.js

var config = {
  "paths": {
    "pym": "https://pym.nprapps.org/pym.v1"
  }
};

  app/design/frontend/vendor/theme/Magento_Theme/default_head_blocks.xml

<page xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <referenceContainer name="content">
        <block class="Magento\Framework\View\Element\Template" name="pym_child" template="Magento_Theme::js/pym_child.phtml"/>
    </referenceContainer>
</page>

  app/design/frontend/vendor/theme/Magento_Theme/templates/js/pym_child.phtml

<script type="text/javascript">
  require([
    "pym"
  ], function () {

    var pymChild = new pym.Child();

  });
</script>

The error I keep getting is

  Uncaught ReferenceError: pym is not defined
      at Object.execCb (require.js:1650)
      at Module.check (require.js:866)
      at Module. (require.js:1113)
      at require.js:132
      at require.js:1156
      at each (require.js:57)
      at Module.emit (require.js:1155)
      at Module.check (require.js:917)
      at Module.enable (require.js:1143)


texts: After submitting the authorization form, the loader does not appear. how to implement it?


texts: Magento 2 - Best approach for retrieving product data - REST API or Custom Endpoint?

texts:
I would like to know what you think the best approach is for retrieving product data from an external source in Magento 2

I have tried two options and both work but I would like to know what you think is the best method:

Method 1 - Custom Endpoint

Using a controller I can make a GET request to:
http://domain.com/modulename/product/index And pass the SKU as a Param in the request from an external source

Then my controller will call my helper class and return a JSON array of product data:

public function execute()
{
    /**
     *  We would normally create some basic Auth check before instatiating the getProduct() method
     *  The Auth token would be stored in the admin config of the module using system.xml
     */
    return $this->resultJsonFactory->create()->setData($this->helper->getProduct());
}

And my Helper

  public function getProduct()
    {
        // This is just for the test I am going to load a configurable product then get the child products
        // Normally the loop would check but this is only for the test.
        $product = $this->products->get('MH01');
        // This is the parent product name and concatenated the SKU
        $productData['name'] = $product->getName() . ' ' . $product->getSku();
        // Get the child products
        $childIds = $this->configurable->getChildrenIds($product->getId());
        $childData = [];
        foreach ($childIds[0] as $childId) {
            $simple = $this->products->getById($childId);
            $childData[] = [
                'name' => $simple->getName(),
                'sku' => $simple->getSku()
            ];
        }
        return ['parent' => $productData, 'children' => $childData];
    }

The other approach would be to use the Magento REST API Webservice method

Method 2 - REST API

I set the route via webapi.xml then make a GET request to:
http://domain.com/rest/V1/module-name/products/{$id}

<?xml version="1.0" ?>
<routes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Webapi:etc/webapi.xsd">
    <route method="GET" url="/V1/costa-test/products/:id">
        <service class="Costa\Test\Api\ProductsManagementInterface" method="getProducts"/>
        <resources>
            <resource ref="anonymous"/>
        </resources>
    </route>
</routes>

The ProductsManagementInterface Class will take the $id and pass it

interface ProductsManagementInterface
{
    /**
     * GET for products api
     * @param string $id
     * @return string
     */
    public function getProducts($id);
}

Then in my ProductsManagement Class

public function getProducts($id)
{
    // This is just for the test I am going to load a configurable product then get the child products
    // Normally the loop would check but this is only for the test.
    $product = $this->products->getById($id);
    // This is the parent product name and concatenated the SKU
    $productData['name'] = $product->getName() . ' ' . $product->getSku();
    // Get the child products
    $childIds = $this->configurable->getChildrenIds($product->getId());
    $childData = [];
    /** @var $childIds array */
    foreach ($childIds[0] as $childId) {
        $simple = $this->products->getById($childId);
        $childData[] = [
            'name' => $simple->getName(),
            'sku' => $simple->getSku(),
        ];
    }
    return ['parent' => $productData, 'children' => $childData];
}

Both approaches work well but what would you say is the best method?


texts: Magento Connect Manager: Access is locked. Please try again in a few minutes

texts:
does anyone encounter similar issue with this?

"Access is locked. Please try again in a few minutes."

I did clear,flush the cache, reindex but still not working.

Thanks


texts:
At the website i'm currently running, the button for guests to log in is really tiny and essentially hard to find, i want to know if it's possible for me to resize the parameters, i'm currently using the free theme 'Hellowired' do i need to change the size through the correct form in the root directory?
Or is this possible to work this out in Magento Backend itself?


texts: Magento2 how to stop generating Cache for Images?

texts: I don't want Magento to generate cache for images. How can I restrict cache generation for images?


texts:
people. My question may be simple but I can't find an answer. I want to be able to get the page source of my orders with a command. I plan something like
wget -user myUserName -password myPassword https://mywebsite.com/index.php/admin/admin/sales_order/index/key/somekey9sdf9s7978fds97s8fds9/
But this only downloads the admin login page. Thanks in advance.


texts: Magento 2 : how to addCategoriesFilter with AND condtion?

texts:
I want to filter product collection by multiple category ids with AND condition.
I have tried below code for same but it's not working.
below codes return products collection which has category id 1132 or 1169.
but I want product collection which has both categories 1132 AND 1169

public function getProductCollectionByCategories()
{

        $categories = [1132,1169];//category ids array
        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->addCategoriesFilter(array('in' => $categories));
        return $collection;
}


texts:
Top menu bar is not getting selected.

\app\design\frontend\default\new_design_test\template\tm\custommenu\top.phtml

   <?php foreach ($_categories as $_category): ?>
        <?php echo $this->drawCustomMenuItem($_category) ?>
    <?php endforeach ?>

Not understanding Where to write selected code?

Can anyone tell why menu is not getting selected?


texts: Magento 2 : Running magento 2 on windows using windows subsystem for Linux

texts: Is there some good guide on how to use Linux subsystem provided with Windows 10 to set up and run Magento 2?


texts: Magento 2 : Can a single UI Component node have more than one collection?

texts:
Magento2 - Is it a good practice to give 2 collections or more in my UI Component tag as shown :

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="brand_listing_data_source" xsi:type="string">HBPlus\Brand\Model\ResourceModel\Brand\Grid\Collection</item>
            <item name="group_listing_data_source" xsi:type="string">HBPlus\Brand\Model\ResourceModel\Group\Grid\Collection</item> <!--Can this be given? -->
        </argument>
    </arguments>
</type>

I had separated out the collections under the same node as below for which i used to get this error:

Fatal error: Uncaught exception 'Magento\Framework\Exception\LocalizedException' with message 'More than one node matching the query: /config/type[@name='Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory']' in /var/www/html/Namespace/vendor/magento/framework/Config/Dom.php on line 276

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="brand_listing_data_source" xsi:type="string">HM\Brand\Model\ResourceModel\Brand\Grid\Collection</item>
        </argument>
    </arguments>
</type>

<type name="Magento\Framework\View\Element\UiComponent\DataProvider\CollectionFactory">
    <arguments>
        <argument name="collections" xsi:type="array">
            <item name="group_listing_data_source" xsi:type="string">HM\Brand\Model\ResourceModel\Group\Grid\Collection</item>
        </argument>
    </arguments>
</type>


texts: Bundle multiple API calls in a single transaction

texts:
Is there any way that I can bundle multiple SOAP API calls into a single transaction, such that if one or more fails the entire transaction is rolled back?

In my particular case, I am attempting to post a shipment and add tracking information. However if the posting of the shipment or adding tracking information fails, I would like to log the error and retry once it is resolved. This would be better than having a shipment without tracking information.

If this is not possible in the current SOAP API, I will delete the shipment upon failure. I would prefer to use a transaction though.


texts:
Magento has the facility of 301/302 re-directs. I'm working on a project for which 301 works fine for each country, say if I'm visiting from India, it re-directs me to example.in from example.com . It's configured at System->Configuration->Web->Url Options->Auto-redirect to Base URL. Though I see re-directs are also configured in .htaccess file. like
RewriteCond %{REQUEST_URI} (.*)\.html
RewriteCond %{REQUEST_URI} [A-Z]
RewriteRule . ${lc:%{REQUEST_URI}} [R=301,L]

RewriteCond %{HTTP_HOST} ^example\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

I see few other 301 re-directs are mentioned in .htaccess file like
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{REQUEST_URI}  ^/ShowReviewDetails\.do$
RewriteRule ^(.*)$ http://www.example.com/saree.html? [R=301,L]
# simple redirect
Redirect 301 /Craft.do    http://www.example.com/craft.html
Redirect 301 /Welcome.do  http://www.example.com/
Redirect 301 /Craft.do  http://www.example.com/craft.html

Which 301 re-direct is in action? I've to change all 301 re-directs to 302. Do I need to change 301->302 in admin section only or I need to change all occurrences of 301 to 302 in .htaccess file also?
Also, I see, in Catalog->URL Rewrite Management , 301 re-directs are enabled for each store view. Do I need to change it here also or I need to make change only at System->Configuration->Web->Url Options->Auto-redirect to Base URL ?


texts:
I have a report to list all orders that are part shipped but the data does not match what I am seeing in the pages Magento generates itelf. My code is below...

 $collection = Mage::getModel('sales/order')->getCollection()
    ->addAttributeToFilter('state', array('neq' => Mage_Sales_Model_Order::STATE_COMPLETE))
    ->addAttributeToFilter('state', array('neq' => Mage_Sales_Model_Order::STATE_CANCELED))
    ->addAttributeToFilter('state', array('neq' => Mage_Sales_Model_Order::STATE_CLOSED));

    $collection->getSelect()
    ->joinLeft(array('sfsg' => $collection->getTable('sales/shipment')), 'main_table.increment_id = sfsg.increment_id', array('shipped'=>'sfsg.created_at'))
    ->where('sfsg.created_at IS NOT NULL');
    $this->setCollection($collection);
    return parent::_prepareCollection();

So the first part defines that no orders with a status of complete, canceled or closed are selected eg orders that are part shipped and the leftJoin bit joins the sales_flat_shipment table on increment_id (order id). This then pulls out created_at which is when the shipment was created/sent.

This produces my report no bother but the data inside it does not match what I see if I look at a report using Magento's built in facilities.

Where I am going wrong here? It must be the leftJoin that is not right I'm thinking. Is there any useful documentation on this that would explain the relationship between an orders first shipment or earliest shipment?


texts: Magento Replace bundle product price with new base price

texts:
I am building a magento store for gaming pcs,where the PC is a bundled product, Now i need to keep the base price i.e. "Initial price of the product" to be a defined amount by admin and NOT the sum of the default options, and when the customer selects any option from the product page, than the price should be calculated acording to the base price.

Thanks.


texts: How to add comment for custom category attribute

texts:
i created a custom attribute for a category and want to add a comment on this attribute

how to add comment for costume attribute ?

$installer->addAttribute('catalog_category', 'externallink',  array(
'type'     => 'varchar', /* Type - see eav_entity_* for the different types */
'label'    => 'External Link Url', /* Your label */
'input'    => 'text', /* This refers to the type of form field should display*/
'global'   => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
'visible'           => TRUE,
'required'          => FALSE,
'user_defined'      => FALSE,
'default'           => ''
));


texts:
If I open any product,by default "General" tab is showing.

Like below screenshot.

But I want to open "Prices" tab by default.
Like below screenshot.

Anyone can tell me how to do that.?


texts: How to Sort after position a product collection?

texts:
This is how I get my collection:

$_productCollection = $this->getItemCollection();

This is how I get the products:

foreach ($_productCollection as $_product):
     echo $_product->getData('position');
endforeach

At the moment I get my products randomly. Can I sort by position  ? if yes how can i do it ? thx

This is the getItemCollection function from CORE:

public function getItemCollection()
    {
        if (is_null($this->_items)) {
            $behavior   = $this->getPositionBehavior();

            $this->_customItems = array();
            $this->_items = array();

            if (in_array($behavior, $this->getRuleBasedBehaviorPositions())) {
                $this->_items = $this->_getTargetRuleProducts();
            }
            if (in_array($behavior, $this->getSelectedBehaviorPositions())) {
                foreach ($this->_getLinkProducts() as $id => $item) {
                    $this->_customItems[$id] = $item;
                }
            }
            $this->_orderProductItems();
        }

        return $this->_items;
    }


texts: Magento 1.9, getting 404 on category pages after renaming Store Name

texts:
Im struggling on this so i need help please, i have 2 websites on the same magento installation ( 1.9.3.8 ) :

CANADA ( default, code : base )
English (store view code : en_ca )
French ( store view code : fr_ca )

USA ( code : usa )
English ( store view code : en_us )

Add store code to url : yes
Use web server rewrites : yes

the default website was the Canada one, but we decide to use USA as default, so i did this on dev ( i have no production site yet, still in dev mode ) :

Delete the USA website ( do you want to create a DB backup - i answer NO )
now i have the default website only ( canada with 2 languages ),
I rename the Website name to USA ( keeping code to : base ),
I rename the Store Name to USA store,
I rename the Store view from en_ca to en_us,
i delete the fr_ca store view.

After that i create my new website Canada with previous deleted settings, i reassign all my CMS pages and static blocks the the new Website, reindex, clear cache.

Everyting work except the USA - default(en_us) categories, it gives me a 404 ( not cms page 404, the default magento ugly blue & orange one ). All my products and CMS pages are working good.

What ive done since, i create a second store view in default website ( en_us2 ), this one work, i also create another root category and assign it to the USA Store, keep having this 404.

So it look like the default store view categories are down for some reason i did.

is there anyone that have face this issue before and/or have maybe a solution ?

thank you


texts: Changing the http-equiv= tag between pages

texts: Is it possible to modify the meta tag “http-equiv” in the local.xml? What I’m trying to achieve is rendering a tag on one page that reads: <meta http-equiv="X-UA-Compatible" content="IE=8" /> and on another page: <meta http-equiv="X-UA-Compatible" content="IE=9” />. Is it possible to do this, or will I have to write PHP logic in the head.phtml file to achieve this?