texts: How to add a configurable product to cart (by child id and quantity)?

texts:
I have the quantity and the id of a child product. Now I want to add it to the cart. But I get always the exception "Sale was closed for this product.". - Makes sense because the child product isn't visible individually.

But how can I add this product (or the parent with the right attributes) to the cart?

I tried to customize this solution but had no success.

Any help is much appreciated. Thank you.


texts: remove credit card information Packing Slip magento

texts:
I want to remove Credit card information from packing slip.

I try in app\code\core\Mage\Sales\Model\Order\Pdf\Shipment\Packaging.php file and all related files to remove this but no success.


texts: Magento 1: purpose of Magento index tables vs MySQL indexes

texts:
I've been working with Magento for years and I feel like this is a stupid question but anyway, I feel like I need some clarifications.

As you may know, Magento 1 comes with several index tables such as (I won't list them all):

cataloginventory_stock_status_idx
catalog_category_anc_categs_index_idx
catalog_category_anc_products_index_idx
catalog_category_product_index
catalog_product_enabled_index
catalog_product_index_* tables
report_viewed_product_index

I know what is the purpose of an index, however I'm wondering how is it better to use index tables over MySQL indexes ? I'm wondering especially when should one use index tables in a custom module ?


texts: Magento 2: override block class by product type

texts:
Sorry but I dont know how to define my quetion.Let me show you code :

Magento 1 :

 <checkout_cart_index>
    <reference name="checkout.cart">
        <action method="addItemRender">
            <type>simple</type>
            <block>mymodule/checkout_cart_item_renderer_simple</block>
            <template>checkout/cart/item/default.phtml</template>
        </action>
     </reference>
</checkout_cart_index>

Above code is for override simple product entry in cart page.

Now my query is how can I achieve same thing in Magento 2.

Thank you.


texts: paypal express checkout not sync with magento 2.2.4

texts:
When an Order is placed, registered notification about transaction complete on Paypal is not updated automatically in comment history.
Whenever we Refund the amount from Paypal, registered notification about refunded amount is not updated automatically in comment history.
If the order is in "Payment Review" status at the time order placing, then it should be automatically changed to "Processing" status whenever the funds got cleared from PayPal. Currently this is not syncing automatically from PayPal and we have to click on "Get Payment Update" to check the status.

Preconditions
 Magento 2.2.4
 PHP 7.1.18
 PayPal Express enabled in-checkout payment methods(for sandbox mode)

Steps to reproduce
 STEP:1 place order on magento store.
 STEP:2 Go to https://www.sandbox.paypal.com
 STEP:3 open recent order history
 STEP:4 issue refund

Expected result
paypal transaction status maintain in magento admin order view page in comment history section and also refund comment should be visbile on order view page in comment history section.

Actual result
 there is no sync between paypal and magento store. any activity which done in paypal panel ,not reflect in magento admin panel.

below the screenshot of magento 2.1.7 admin order view page when the order is placed from paypal expree checkout .


texts:
I'm trying to disable the redirection to cart when you clicking on add to cart. I use magento 1.9.0.1. I heave searched on the internet for an anwser. The only option i find is to go to system->configuration->checkout and then disable the redirection. But when go to system->configuration i can't find the checkout. It should be under sale but it's not there. Does anyone know where i can find the checkout or how i can disable te redirection to cart after i click the 'add to cart'button.
Tnx!


texts: Layout Updates in theme.xml to pick up parent theme's xml

texts:
I've created a theme package called hoi with a default theme.  In the app/design/frontend/hoi/default/etc/theme.xml I've set a parent theme to be the a theme we purchased called blacknwhite.

This almost works but it does not pick up the layout.xml from the blacknwhite theme as my own theme's xml overwrites it.  It works when I copy and paste the contents from the blacknwhite theme's xml into my own theme's xml.  But I would rather not do this as so I tried to create a new layout update in my theme's theme.xml.

theme.xml

<theme>
    <parent>blacknwhite/default</parent>
    <layout>
        <updates>
            <hoi_default>
                <!--should be linking to app/design/frontend/hoi/default/layout/parentslocal.xml-->
                <file>hoi/parentslocal.xml</file>
            </hoi_default>

            <hoi_default>
                <!--should be linking to app/design/frontend/hoi/default/layout/local.xml-->
                <file>hoi/local.xml</file>
            </hoi_default>
        </updates>
    </layout>
</theme>

This way I hoped to have my own local.xml for my theme which would fall back onto a parentslocal.xml which I would then copy the contents of the parents local.xml to. But it's not working.

I tested it by putting the below in my local.xml but it did not work.

<layout version="0.1.0">
    <default>
        <reference name="header">
            <remove name="cart_sidebar"/>
        </reference>
    </default>
</layout>

I would have thought Magento would inherit from it's parent's theme more seamlessly.

I'm thinking it is perhaps better off putting my sub theme in blacknwhite/hoi!


texts: How to let customer create bundle product?

texts:
Where to start to let some customers create their own bundle product?
We can create bundle product in the PHP code. But how to display product selection similar to the admin one, inside the customer dashboard?


texts: Magento 1.9 Display Sub Categories On A Category Page

texts:
My store running on Magento 1.942.

I want to display subcategories on a category page, and find this guide https://www.magemonkeys.com/how-to-display-sub-categories-on-a-category-page-in-magento/.

I create a Static Blocks and subcategory_listing.phtml according to the guide, everything works fine.

but when I enable cache in "Cache Storage Management", All parent categories on my store display the same subcategories (For example, after refreshing the Magento cache, if I click on the A parent category and then click on the other parent category, the subcategories under the A parent category are displayed.).

I refreshed the Magento cache, the browser cache, but nothing changed.

here are the codes of subcategory_listing.phtml

<?php
$layer = Mage::getSingleton('catalog/layer');
$_category  = $layer->getCurrentCategory();
$_categories = $_category->getCollection()->addAttributeToSelect(array('url_key','name','image','all_children','is_anchor','description'))
->addAttributeToFilter('is_active', 1)
->addIdFilter($_category->getChildren())
->setOrder('position', 'ASC')
->joinUrlRewrite();
?>

<?php foreach ($_categories as $_category): ?>
<?php if($_category->getIsActive()): ?>
<?php Mage::log($_category->debug(), null, 'mylogfile.log'); ?>

<a class="now-from-container" href="<?php echo $_category->getURL() ?>">

<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>">
<img src="<?php echo $this->htmlEscape($_category->getImageUrl()) ?>" width="135" alt="<?php echo $this->htmlEscape($_category->getName()) ?>" />

<a href="<?php echo $_category->getURL() ?>" title="<?php echo $this->htmlEscape($_category->getName()) ?>"><?php echo $this->htmlEscape($_category->getName()) ?>

<?php endif; ?>
<?php endforeach; ?>


texts:
I'm working in magento 1.9 version.
I have done the following features using Promotion codes:

Buy 1 Get 1

but, I want to implement the following concepts

Buy this(let say Prod A) Get that (let say Prod B)
Buy x num of prod and get Y num of products

How to do this. Is there any free or paid extensions available for this.
I found this free extension. But it is not working.


texts: Add custom field in shipping and billing section onepage at checkout

texts: I have to add one custom field in shipping and billing area call something like"ConfirmZip Code"  i have searched lot of tutorialsbut now worked for me ia using magento 1.9.1


texts: Magento 2.1: Default setting for "Store View"

texts:
Whenever I edit a product, the Store View (scope) is set to "All Store Views" each time.

In my particular setup, I would like this to default to Main Website > Main Website Store > Default Store View, but can't find a way to do it.

Any advice? The solution can be a configuration setting or programmatic, I don't mind.


texts: Enterprise 1.14.2.0: Problem with understanding getProductsReadonly function

texts:
My Task was enabling Position field on category product selection grid some how position box was hidden category product selection grid.

In the debug process i find out there is a function

$this->getCategory()->getProductsReadonly()

which is responsible for enable editable text field but i could not found any getProductsReadonly or setProductsReadonly also i could not found any attribute products_readonly.

Question1 : Is anyone can help me to understand definition for getProductsReadonly ?

Function always return null.

So in my case this solution wasn't work because there is some embedded css called in phtml(app/design/adminhtml/default/default/template/merchandiser/smartmerch/tab.phtml) file

<?php if (Mage::helper('merchandiser')->isHideProductPositionField()): ?>
    <style>#catalog_category_products_table tbody tr td.editable .input-text { visibility:hidden; }</style>
<?php endif; ?>

I am sure that this file isn't changed and it came form magento.

Question2 : Is this right way to call embedded css by magento team ? I mean they can override or use getProductsReadonly function rather then hide text box by css.


texts:
I am getting following error on whole website even i am not able to open admin panel.

I have set all the permissions ( pub, var to 0777 ) as required for magento 2 project.

Any help would be appreciated!

Thanks in advance


texts: Taxes Calculated Differently for Shipping Address vs Default State Tax Calculation

texts:
I've looked through other tax calculation issues on Stack Exchange and believe that my issue may be unique. I'm running Magento 1.9.3.8 with TaxJar 2.3.3. I'm also using Inchoo_PHP7 so Magento runs on PHP 7.0.29, in case that matters.

So, my problem: When a customer is located in the state of Texas where we have a Nexus, the tax rate is being calculated incorrectly. Instead of the correct rate of 8.25%, the tax rate is being calculated at 8%.

I use TaxJar to maintain the correct tax rates for Texas and Louisiana, since we have a nexus in each state. Those tax rates all seem to be correct. Texas, in particular, has a single state-wide rate of 8.25%.

Under System -> Sales -> Tax, I've got it configured to have no default tax destination calculation. So the user isn't shown taxes until they've entered their destination state, either through the shipping estimator or when entering their shipping address.

If I change the Default State to Texas, then I initially get the correct calculation (8.25%). But the moment the customer does a shipping estimate or enters their shipping address (in Texas), the calculation switches to the incorrect rate (8%).

How can that be? How could setting the Default State to Texas differ from the customer entering a Texas shipping address when calculating the tax rate?

I have pored over the tax tables, System settings, etc and found no tax rate setup for Texas that's 8%. Nor have I found a default tax rate that's 8%. The only other broader tax rate entry would be for Wholesale Customers, which is 0%. So that wouldn't be the issue.


texts: Shipping Templates Zend PDF Generator Permissions Denied

texts:
When I try to create a shipping label in Magento Commmunity Edition 1.9, I'm facing a permissions error in system.log:

Warning: imagepng(/var/folders/f3/pd3xtxvd0y390_qjv7pryv6m0000gn/T/shipping_labels_11721274915437009a686f81412890778.png): failed to open stream: Permission denied  in /Applications/MAMP/htdocs/my_site/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php on line 732

I am also faced with the following error in exceptions.log:

exception 'Zend_Pdf_Exception' with message 'Cannot create image resource. File not found.' in /Applications/MAMP/htdocs/my_site/lib/Zend/Pdf/Resource/ImageFactory.php:38
Stack trace: #0 /Applications/MAMP/htdocs/fswings/lib/Zend/Pdf/Image.php(124): Zend_Pdf_Resource_ImageFactory::factory('/var/folders/f3...')

As well as the less informative error on the front-end:

An error occurred while creating shipping label.

I've set my permissions site-wide (while developing) to 755 for folders and 644 for files.  I tried several things to see if this is indeed a permissions issue:

I've temporarily set permissions on ShipmentController.php to 777
I've temporarily set permissions recursively on the var folder to 777
When that didn't work, I tried setting permissions recursively on the whole project file to 777
I've tried to disable and enable the cache, as well as flushing it

My theory is the pdf generator Zend uses is unable to write to var, as I do not see a var/folders directory.
Anyone else have this issue?


texts: Phone number magento validation not working in Register and MyAccount Page - Magento 2.3.5-p2

texts:
i try to add magento validation to make it display "Please enter a valid phone number, without dashes or non-numerical characters." like this, and also magento validation can only make me enter number only and include "-" automatically
i have added data-mage-init='{"validation":{}}' and in some file added data-validate="{'validate-number':true}"
Nothing works in registration page form and myaccount address form.
app/design/frontend/MyVendor/MyProject/Magento_CustomerCustomAttributes/templates/customer/form/register.phtml
<form class="form create account form-create-account asd" data-mage-init='{"validation":{}}' action="<?= $block->escapeUrl($block->getPostActionUrl()) ?>" method="post" id="form-validate" enctype="multipart/form-data" autocomplete="off">

app/design/frontend/MyVendor/MyProject/Magento_Customer/templates/address/edit.phtml
<form class="form-address-edit"
      action="<?= $block->escapeUrl($block->getSaveUrl()) ?>"
      method="post"
      id="form-validate"
      enctype="multipart/form-data"
      data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>" data-mage-init='{"validation":{}}'>

app/design/frontend/MyVendor/MyProject/Magento_Customer/templates/widget/telephone.phtml
<input type="text"
               data-validate="{'validate-number':true}"
               name="telephone"
               id="telephone"
               value="<?= $block->escapeHtmlAttr($block->getTelephone()) ?>"
               title="<?= $block->escapeHtmlAttr(__('Phone Number')) ?>"
               class="input-text <?= $block->escapeHtmlAttr(
                   $block->getAttributeValidationClass('telephone')
               ) ?>"
        >

app/design/frontend/MyVendor/MyProject/Magento_Customer/templates/form/register.phtml
<form class="form create account form-create-account" action="<?= $block->escapeUrl($block->getPostActionUrl()) ?>" method="post" id="form-validate" enctype="multipart/form-data" autocomplete="off" data-mage-init='{"validation":{}}'>

app/design/frontend/MyVendor/MyProject/Magento_CustomerCustomAttributes/templates/customer/address/edit.phtml
<form class="form-address-edit" action="<?= $block->escapeUrl($block->getSaveUrl()) ?>" method="post" id="form-validate" enctype="multipart/form-data" data-hasrequired="<?= $block->escapeHtmlAttr(__('* Required Fields')) ?>" data-mage-init='{"validation":{}}'>


texts: Magento 2 Add custom field to customer registration form

texts:
I want to add custom fields to my Magento 2 customer registration form.
Should I use a DB UpgradeData script to add fields to the Magento DB table, or should I add my own table?

If I add my own table, how do I get my custom data and the default data to show up in the same place?

Thanks


texts: Magento 2.3 - Delta Migration SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry

texts:
Before a month successfully migrated settings and data, now I want to setup Delta migration for update orders and customer details if i run following command

php bin/magento migrate:delta
vendor/magento/data-migration-tool/etc/opensource-to-opensource/1.9.2.3/config.xml

I am getting the following error,

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry
'4799     0-1' for key
'CATALOGINVENTORY_STOCK_ITEM_PRODUCT_ID_STOCK_ID'

How to solve the issue?

Note:  If delete Duplicate entry 47990 then a new error will generate
Duplicate entry 47991 it will keep continuing, my id up to 50036, how
to solve this issue


texts: Magento Payment successful redirect issue

texts:
In my site I have issue in payment redirect URL.
It works fine in Google Chrome but it redirects to empty cart page in Firefox.

When I clicked on place order button, I redirect on Payment gateway page, after successful payment, the URL of site not going on Success page, it redirects on Empty Cart Page


texts: Get visibility of product in product list

texts:
Within a product list, I would like to access

$product->getVisibility()

for each product of the collection. However, this is always null instead of either of the 4 states. I have already added

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <group name="catalog_product">
        <attribute name="visibility" />
    </group>
</config>

to the app/code/<vendor>/<module>/etc/catalog_attributes.xml. While this works fine for other custom properties of the products, it does not seem to have any affect on the visibility property - and I have no idea why.

Magento 2.3.2


texts: I believe this is a Ultimo theme issue. The author has stopped updating the theme. I have this theme on Magento 2.3.3. Pagination Next/Previous not working intermittently on iPhone. Sometimes it works after clicking twice with no response or error in console to one click. As you can see from the screenshot taken from a iPhone that a click on page 2 is stuck with number 2 label highlighted with black color.


texts: Magento 1.9 Invalid Secret Key. Please refresh the page

texts:
After new magento 1.9 installation when I am login to the admin panel there is a fine flow.

After that if I am opening admin panel on other tab like:

  www.example.com/admin

It is showing error on dashboard

  Invalid Secret Key. Please refresh the page.


texts:
I want to use JavaScript in my own custom Magento Module.

Unfortunately I do not have any clue how I can access it.

Another important thing to note is that I need to have access to JQuery.


texts:
I have updated magento from 2.2.7 to 2.3.1 and I get a setup:upgrade error but have no idea where to look.

The error is for the following query:

  SHOW INDEXES FROM catalog_category_product_2.0.7 WHERE Non_unique =
  1

There is an error because the table has no quotes and the version 2.0.7 is not valid.

Any help is appreciated.

Update 1: Added a screenshot

Update 2: Not quoted

It looks like that in the following file the with readIndexes the $tableName is not quoted. Not any of the functions the tablename is quoted and the errors continue.

  vendor/magento/framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaReader.php


texts: Importing configurable products having super product attributes

texts:
I've magento version 1.9.0.1. It's easy to import/export simple product however a little tricky is configurable products. I'm able to import configurable product too but since I don't know what is the heading name and values for the super product attributes I'm unable to get the different select options. I'm attaching the backend of the Super product attributes. If someone can simply write here what heading I must use and how to give it's values in multiple, it would be wonderful.

Thanks


texts: How can I move compare product link in header | Magento 2

texts:
How to move compare product link into header, Right now it is in top links. So to do so I've tried putting following line in my default.xml

<move element="compare-products-link" destination="header-wrapper" />

But it's not working ,another alternative was by putting following line

<move element="catalog.compare.sidebar" destination="header-wrapper" />

But it's putting whole div structure and I don't want it, I just want to have link. so any suggestions??


texts: Remove "My billing and shipping address are the same" checkbox and Billing address form open By default Magento 2

texts:
I am using the one step checkout and it is working fine.
Now, requirement is that , remove the "My billing and shipping address are the same" checkbox and open the Billing address form by default on load.
Please check this screenshot,

Your help would be appreciated.


texts: Magento 2.3.2 Invalid entity_type specified: Magento\Quote\Api\Data\AddressInterface on checkout

texts:
I have created a custom select field on the checkout address form. a field is displayed fine but when clicking on next button getting error "Invalid entity_type specified: Magento\Quote\Api\Data\AddressInterface on checkout"

Check below the screen-shot.

I have followed the below links but no luck.

Add a new field in address form
How To Add Custom Field At Checkout Address Form In Magento 2
How to add new fields in address form

Any help would be appreciated! Thanks.


texts: Where does magento save UI Grid filter data?

texts:
Where does magento save UI component Grid applied filter data?

Deleted session table but applied filter data does not save there


texts: how do I sort related products by position? magento 1.6

texts:
Sort order of related products seems to be same with sort order of category products.

I would like to use position for sorting.
when I tried to set position fields of related products and reindex category products, nothing happen.

Does someone know how to edit specifically for related products?

Sorry Amit

I can't understand your solution.
I just would like to use magento default function.

Usually, if I set positional order in related product tab in product editing page.
It can use.

I searched the internet and somebody says related.php file has a bug in this thread.
Do you think so?

core>Mage>Catalog>Block>Product>List>Related.php

Original

$this->_itemCollection = $product->getRelatedProductCollection()
        ->addAttributeToSelect('required_options')
        ->addAttributeToSort('position', Varien_Db_Select::SQL_ASC)
        ->addStoreFilter()

to

$this->_itemCollection = $product->getRelatedProductCollection()
        ->addAttributeToSelect('required_options')
        ->setOrder('position', Varien_Db_Select::SQL_ASC)
        ->addStoreFilter()

but this solution also not working for my site.


texts: I want to update order status using magento's rest api

texts:
I want to use Magento Api for Updating Status of order in Magento 2.3.5 so anyone can guide me from scratch how can i use api. I also want to know in Magento how many default api is there and how to use api in php file. so anyone have idea then please share with me.
Thank you In Advace.


texts: Magento 2: How to login with Facebook Rest API

texts:
I'm building Rest API and I have to make login with social media.

I found that there are extensions that used for that but what if I want to build API for mobile application.

How to do that.


texts: image preview not loading in backend after SUPEE patches

texts: I just updated my magento 1.7.0.2 store to the latest SUPEE patches and shortly after when I was adding a new product to my site I found that something was wrong.  When I upload a new image the jpg/png file won't preview like it used to.  The exisiting images on other products load and preview when I place my cursor over them, but new images just give me the no preview icon.  Where do I start to look here?


texts: Updating customer address book with an additional address in Magento 1.9

texts:
I have been asked to fix a form which should add a new (non-default) billing address to a customers account. The action of the form is empty and when submitted a billing.Save() function is executed.

In trying to work out what might be broken I have struggled to find an explanation as to how saving a new billing address for an existing customer works.

Could anyone point me to the where this is handled and how I would go about this from a form in the template/checkout/onepage/billing.phtml template file.

Thanks


texts: Magento 2: base URL to use in hardcoded links

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

In the back-end, I have created a block with a custom, hardcoded, navigation like:

Home

About

Blog

Contact Us

The question: Is there a piece of code for the website's base URL (a term often used in Codeigniter), so that the code above can be reusable?


texts:
I am trying to add the product title and short description within the product tabs on the luma theme. With short description, I am happy to use the move object to place this into the tabs but I need to style it with a  tag, with the product title I want to replicate this so I will have it as a h1 and h3. Below is the code I have added to description.phtml but I cannot get this to render correctly

<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?>

<?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?>

<?= /* @escapeNotVerified */ $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getDescription(), 'description') ?>


texts: How to add elements in the second page PDF

texts:
I created a second page using this line of code:

Mage_Sales_Model_Order_Pdf_Invoice::newPage();

Now I am trying  to write something in the second page

$page->drawText("My Test", 50, 700, 'UTF-8');

The height is set to 800, $this->y

How can i write smth in the second page of the pdf ? thx


texts: XAMPP and Magento directory Selector problems

texts:
Ok I have an annoying issue. I have some code in a custom helper module that i use to resize images and save a cached copy. Now this does not work. However if i go into mage.php and change the declared variable DS from DIRECTORY_SEPARATOR to / it works perfectly. However then some community modules break who use the standard DS.

Here is my method:

public function resizeImg($fileName, $width, $height, $constrain = false, $ratio = false)
{
    $folderURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA);
    $imageURL = $folderURL . $fileName;

    $basePath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . $fileName;
    $newPath = Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . "resized" . DS . $width . DS . $fileName;
    //if width empty then return original size image's URL
    if ($width != '') {
        //if image has already resized then just return URL
        if (file_exists($basePath) && is_file($basePath)/* && !file_exists($newPath)*/) {
            $imageObj = new Varien_Image($basePath);
            $imageObj->constrainOnly($constrain);
            $imageObj->keepAspectRatio($ratio);
            $imageObj->keepFrame(FALSE);
            $imageObj->resize($width, $height);
            $imageObj->save($newPath);
        }
        $resizedURL = Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_MEDIA) . "resized" . DS . $width . DS . $fileName;
     } else {
        $resizedURL = $imageURL;
     }
     return $resizedURL;
}

And the working app/Mage.php

define('DS', DIRECTORY_SEPARATOR);

Now if i change that DS to '/' it works fine.

I then tried the following:

define('DS2', '/');

Then changes the DS to DS2 in my method, but this also did not work, nor does changing it to a string or variable.

from my searching the Directory selector is defined by the type of server, this should be a linux server and yet only when I use DS myself it breaks and tried to output \ instead of /, everywhere else it correctly outputs /.

The hell am i doing wrong?


texts:
I want to show https in my url of all pages of site. Please help me out to make this thing possible. Right now https is only appearing in my home page and checkout page. My site url is https://www.nutriment.com/.

Thanks


texts: how to hide billing information and shipping steps in one page step out

texts:
I want to hide  billing information and shipping from one page checkout.

Please anybody help me to figure out this solutions.


texts: When I enter wrong credit card number I'm getting alert message in gene braintree module

texts: When I enter wrong credit card number in payment I'm getting alert message in gene braintree module. Can I know why it happens and how to resolve it.


texts: Ok so everything was fine and dandy on my machine yesterday, that is until I updated my magento to 1.9.3 and applied the security patch. Since then my images no longer show on the front or back end. The images are in the directories, they have the correct permissions. I have tried looking at some old fixes and none of these work or are irrelevant.


texts: Excluding one or more subcategory in a Category Page that displays Subcategory list

texts:
I have the following code that will display list of subcategories in a category page and I want to exclude several subcategories from displaying but is active in the Navigation Menu.
Category Tree Scenario:

Apparel
--- Men
--- Women
--- Kids

Shoes
--- Men
--- Women
--- Kids

When I clicked on the Apparel category which is part of the Menu/Navigation at top. It will go to the category page of the apparel and display only the subcategory name and subcategory image of Men, Women and Kids. But I to exclude Kids. But it will still be visible in the navigation when you hover Apparel all three subcategories are part of the drop down.

     <?php
      $currentCat = Mage::registry('current_category');
      if ( $currentCat->getParentId() == Mage::app()->getStore()->getRootCategoryId() ){
         // current category is a toplevel category
         $loadCategory = $currentCat;
         }else{
         // current category is a sub-(or subsub-, etc...)category of a toplevel category
         // load the parent category of the current category
         $loadCategory = Mage::getModel('catalog/category')->load($currentCat->getParentId());
          }
          $subCategories = explode(',', $loadCategory->getChildren());

          foreach ( $subCategories as $subCategoryId )
          {
             $cat = Mage::getModel('catalog/category')->load($subCategoryId);
             if($cat->getIsActive()){
                echo '

                getURL().'" class="product-image" >

                   getImageUrl().'" />

                getName().'" href="'.$cat->getURL().'">&nbsp;

                getURL().'">'.$cat->getName().'

&nbsp;

';
           }
      }
   ?>

Looking forward for your help guys. Thank you!


texts: How to get all visible out of stock products in magento 2

texts:
I checked into this and got my nearest answer but not as we usually expecting from magento.

I want all out of stock product which can visible in store front means have respective product landing page (PDP).
which means exclude Not Visible Individually and enable products.


texts: Magento 2.3 : Get all products both disabled and enabled

texts:
i want to list all products but below code is showing only enabled products, i want to get disabled one also

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
/** @var \Magento\Catalog\Model\ResourceModel\Product\Collection $productCollection */
$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\Collection');
/** Apply filters here */
$collection = $productCollection->addAttributeToSelect('*')
            ->load();

foreach ($collection as $product){
     echo 'Name  =  '.$product->getName().'<br>';
}


texts: We can put our logic inside the block. Why we still need a helper? What is the best practice of using a helper class?


texts: Product Collection won't get all products

texts:
I am using a pretty basic product collection but it isn't returning all products in my store. Please find the code below:

$collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');

This returns 4,972 products, but there is a total of 7,265 products in my store which is shown under Manage Products in the admin panel.

Has anyone experienced this before and possibly knows a way to fix this?

Thanks!

EDIT

I have also ran the following code to see the SQL being executed:

echo $collection->getSelect();

This has returned the following SQL:

SELECT 1 AS `status`, `e`.`entity_id`, `e`.`type_id`, `e`.`attribute_set_id`, `e`.`entity_id`, `e`.`attribute_set_id`, `e`.`type_id`, `e`.`cost`, `e`.`created_at`, `e`.`gift_message_available`, `e`.`has_options`, `e`.`image_label`, `e`.`is_recurring`, `e`.`links_exist`, `e`.`links_purchased_separately`, `e`.`links_title`, `e`.`msrp`, `e`.`msrp_display_actual_price_type`, `e`.`msrp_enabled`, `e`.`name`, `e`.`news_from_date`, `e`.`news_to_date`, `e`.`price`, `e`.`price_type`, `e`.`price_view`, `e`.`recurring_profile`, `e`.`required_options`, `e`.`shipment_type`, `e`.`short_description`, `e`.`sku`, `e`.`sku_type`, `e`.`small_image`, `e`.`small_image_label`, `e`.`special_from_date`, `e`.`special_price`, `e`.`special_to_date`, `e`.`tax_class_id`, `e`.`thumbnail`, `e`.`thumbnail_label`, `e`.`updated_at`, `e`.`url_key`, `e`.`url_path`, `e`.`visibility`, `e`.`weight`, `e`.`weight_type`, `e`.`manufacturer`, `e`.`prmotional_text`, `e`.`brand`, `e`.`brand_value` FROM `shop_catalog_product_flat_1` AS `e`

EDIT #2

I have just amended all my products to be included in my main store view (ID 1), but still no luck.

I've also noticed the total number of products changes slightly, it has gone from 4,972 to 4,971 to 4,973.


texts: How to change the CSS only for Myaccount page title?

texts:
I want to change the CSS only for the title of My Account page.

I have added my custom class into the file title.phtml at the path module-theme/view/frontend/templates/html

But it affects all the page title.

How to resolve this issue?

Any help will be appreciated!


texts: Remove admin menu item when module disabled

texts:
I developing magento module which creates menu in admin panel. But when I disable it I would like not to show it. I saw this question : Possible to hide admin menu if custom module is disabled? I added the code to my module file (to see if this method is working) in my adminhtml.xml

<config>
    <menu>
    <depends>
         <config>payment/checkmo/active</config>
        </depends>

and then went to System->Configuration->Payment methods and disabled payment method Check/money order ?

What did I do wrong? What config path should be to check if my module is enabled ?

Thanks in advance.


texts:
Currently I am working on a Multi-vendor module in Magento.

What I need to do:

I need to include Vendor name in each URL.

Eg:

 - domain.com/vendor1/jewels.html
 - domain.com/vendor2/jewels.html

And when user enter product URLs it should become

  - domain.com/vendor1/jewels/product1.html
  - domain.com/vendor2/jewels/product6.html

That means every URL will have the vendor string after baseurl.

*I need a functionality just like Magento uses with multi store were we can set store code in the URL and all frontend URL's will have that store code where we use Magento getUrl *

Eg:

 - domain.com/en/jewels.html
 - domain.com/fr/jewels.html

I Couldn't use this as client wants only one store to keep very low data replication by Magento and the vendor filtering logic is very simple which is already working. So I only have to include the vendor code string in URL like default Magento store code method.

What I did So far:

I made every URL to have vendor code at the end with normal way (by adding GET parameter).

domain.com/jewels.html?vendor=vendor1
domain.com/jewels.html?vendor=vendor2

With the help Apache vhosts config pointed every sub domain into same Magento added all vendors as sub domain so

- vendor1.domain.com/jewels.html
- vendor2.domain.com/jewels.html

Apparently both methods client doesn't want it and they are clear that they want only above method which I have no idea so far where to start. Any direction or any similar extension?

Your Help much appreciated.


texts: Replacing multiple slashes in URL with a single slash

texts:
I have the following htaccess rule that I would like to use in order to redirect www.example.com//test.html (any number of consecutive slashes) to www.example.com/test.html.

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{THE_REQUEST} //+
RewriteRule ^(.*) $1 [R=301,L]

It works on my local instance on MAMP, but, it will not redirect the multiple slashes unless there are more than 2 on a production environment (Amazon). So..

www.example.com//test.html --> www.example.com//test.html (doesn't work)

But

www.example.com///test.html --> www.example.com/test.html (works)

However, if there are multiple occurrences of multiple slashes, all of them are replaced by single slashes sometimes like below.

www.example.com//test//test.html --> www.example.com/test/test.html (works)
www.example.com//test/test.html --> www.example.com//test/test.html (doesn't work)

What's going on? I've read numerous posts on this, and none of them seem to work.


texts: How can i Redirect customer to "Register" page if use email address and password is wrong?

texts:
i am new in magento i want to redirect customer to "Register" page when customer click on
log in button if user email address and password is not match


texts: Magento 2: Invoice quantity of order is wrong after payment successfully

texts:
I got an issue with my order like this image.

It's missing invoiced status in Qty column of order item table but invoiced has already created after payment successfully (I've checked mollie.log) so order still has processing status even that I've made a shipment.
It happens rarely for me, but I have 02 orders, which they appear.
Please help me fix it.

My Magento platform version: 2.3.3
My mollie payment module version: 1.4.3

Reproduce step:

  Order product
  Payment via Ideal
  Check order in Magento backend.


texts: What is the expected speed of Magento 1.9 SOAP API v2 when listing all products?

texts:
We have a Magento 1.9 site and a remote script that retrieves a listing of all products in the system via Magento's v2 SOAP API. This is working at approximately 2,500 products per minute. For a catalog of 10,000 products it takes around 4 minutes to retrieve the full listing.
The code we are using to list the products is:
$products = $proxy->catalogProductList(array("sessionId" => $sessionId, "filters" => $filters));

Is this performance normal or slower than expected?


texts: How to detect all types of bot in Magento?

texts:
I want to detect all types of bot in my site.

Is there any code in magento to detect bots?


texts:
I'm trying to get the URL key of any given category with the ID. I have this;

$categoryId = 3;
$_objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$object_manager = $_objectManager->create('Magento\Catalog\Model\Category')->load($categoryId);
print_r($object_manager->getData());

And this works (in the print_r there is the URL key I need), but category #3 is the top-level category. Whenever I try any subcategory (say ID 5) I get a blank array.
I'm just lost for words, can't figure it out.

In Magento 1.x I used to do this: Mage::getModel('catalog/category')->load($catID)->getUrl() and that worked.

TL;DR: This code works, change the ID to a (correct) category ID and change getData() to getUrl() for the complete category url, or getName() for the category name.


texts: How do I set a custom Magento session variable outside of Magento

texts:
The Magento System is in "web/shop". How do I set a session variable outside of it (e.g. in "web/index.php")? And how do I read it inside of Magento (e.g. in "web/shop/app/...")?

The scenario is the following:
A user visits a landing page (e.g. "web/lp/example.php"). Dependent on the landing page, certain contents in "web/shop" must be customized only for that session.
So a session variable must be set in "web/lp/example.php" to be read later in the shop.

Thanks for your help!


texts: Magento 2 : How to show/Hide custom tab on product detail page based on product attribute?

texts:
I have created a product attribute like, display_custom_tab, if it is yes then show custom tab on product detail page, otherwise do not show tab.

can anyone please tell me how to write condition in xml or any other way to check condition.

Note : ifconfig will not work here, because product attributes are not stored in 'core_config_data'.

So, I have attributes like,

and tab like this,

but tab is always showing on page. I want that if attribute is set to off, tab should hide.

This is my xml to show custom tab.

   <referenceBlock name="product.info.details">
        <block class="Magento\Catalog\Block\Product\View"
               name="warrantyInfo.tab"
               template="Product_CustomTab::custom_tab.phtml"
               group="detailed_info">
               <!--ifconfig="product/is_warranty_display"-->
            <arguments>
                <argument name="sort_order" xsi:type="string">40</argument>
                <argument translate="true" name="title" xsi:type="string">Warranty Info</argument>
            </arguments>
        </block>
    </referenceBlock>


texts: How to locate Bootstrap css/js files in magento 2?

texts:
I am a php developer, though it's difficult to understand magento file structure.

Just now I have started to learn magento, but I couldn't find HTML Bootstrap files, can any one please help me how to locate files and where it will be in magento2.1.7?


texts: How to set discounts on upsell/crosssell products in magento 1.9

texts:
I want to set Discount on a Product which is Up-sell/cross-sell for other product.

Example:
I am selling the following in my Magento store

Blazer $100,
Shirt $60 and
Pant $80

Blazer is a up-sell product for shirt When customer buys Shirt for $80, Blazer will show-up as up-sell product, and that should give 30% discount of Blazer actual price.

But if the same customer Buys the Blazer directly then cost should be $100 (not discounted price)

How can I achieve this? Is there something already inbuilt in Magento or can I make this work with little code change or is there any extension that is available?


texts:
I believe this is a core Magento bug, but thought I'd come here to ask for some suggestions anyway.

I've got an attribute, let's call it colour_code. It's a select attribute (backend is int) and it's configurable. It's identical in eav_attribute and catalog_eav_attribute configuration to the default size attribute by the way.

I've been fixturing products with this attribute in some unit tests, and noticed that if my attribute value (label) is numeric, Magento can get confused with the value and the label, for example:

# Mage_Eav_Model_Entity_Attribute_Source_Abstract::getAllOptions()
Array
(
    Array
    (
        [value] => 902
        [label] => 143
    )
    Array
    (
        [value] => 386
        [label] => 902
    )
    Array
    (
        [value] => 316
        [label] => A01
    )
)

Using the above as a very small example of the result of getAllOptions for the attribute's source ($attribute->getSource()->getAllOptions()), I check the
fixtured products values like so:

// Product fixture has colour_code: A01
$product->getColourCode(); // 316 <--- the option_id

// Product fixture has colour_code: 902
$product->getColourCode(); // 902 <--- the VALUE

The problem is when using colour code 902 it returns 902, instead of the option ID. I don't particularly like the fact that Magento returns the option ID, but understand why. That's fine, as long as it's consistent - in this case it's not at all.

Using 902 as the $value, I've drilled this down to the logic in Mage_Eav_Model_Entity_Attribute_Source_Abstract::getOptionId line 98, where strcasecmp($option['label'], $value)==0 returns false, then $option['value'] == $value returns true on the first entry in that example array (value = 902, label = 143). In this case, the method returns $option['value'], which is 902. It doesn't get a chance to look at the valid option (option_id 386).

public function getOptionId($value)
{
    foreach ($this->getAllOptions() as $option) {
        if (strcasecmp($option['label'], $value)==0 || $option['value'] == $value) {
                                                        ^--- this causes the problem!
            return $option['value'];
        }
    }
    return null;
}

What can I do about this?


texts: Home page error "no Home CMS page configured or found"

texts:
I have created a new CMS page and want to set it as my homepage.

I have tried to change my page through System> Configuration> Web > CMS Homepage, but I got the error message

  "There was no Home CMS page configured or found" in my frontend home page.

How can I fix for this issue?


texts: Google search website redirect for the exact product or categories

texts:
I am using magento 2 for my online store and how can I configure when customer search some product in google it will show the exact link for the product like ebay.

 lIke this.


texts: quickly update an attribute value for number of products belonging to a particular attribute set

texts:
i would like to update attribute_value="integer" for all products where attribute_set_id = "x"

This might be a quick sql command, but i'm not actually able to figure out what tables need to be update.

Thanks

Edit:

This is a system attribute which is created by a plugin. (Not seen in magento admin) I am able to trace it in db in eav_attribute table. But unsure how to update its value with products and attribute_set


texts: Creating administrator account programmatically Magento2

texts:
I have been struggling to create administrators' account using upgradeDataScripts in Magento2 but in vain. I have tried to use the same procedures as used in the command-lines as well as MySQL insert statements to insert the admninistrators in the admin_user table.
When using the MySql insert statement, the passwords have not been encrypted correctly and thus, logging using the created accounts have failed.

I had also tried using the userFactory but i kept getting setAreaCode error despite having tried all the proposed solution on the web to correct the issue.

Can someone please tell me what is the correct way to implement the above requirements?

Thank you in advance for your help.


texts: Magento 2 marketplace extension installing error: Do not run Composer as root/super user!

texts:
I am trying to install an extension with the help of composer for magento 2.
This is my composer.json file

{
    "name": "ankur/module-quickorder",
    "description": "N/A",
    "require": {
        "php": "~5.6.5|7.0.2|7.0.4|~7.0.6",
        "magento/module-store": "100.0.0",
        "magento/module-backend": "100.0.0",
        "magento/module-media-storage": "100.0.0",
        "lib-libxml": "*"
    },
    "type": "magento2-module",
    "version": "100.0.0",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "autoload": {
        "files": [ "registration.php" ],
        "psr-4": {
            "Ankur\\Quickorder\\": ""
        }
    }
}

After creating a composer, when I run this command in putty

 composer require ankur/module-quickorder:100.0.0'

It throws below error in putty

Installation issue: Do not run Composer as root/super user! See [https://getcomposer.org/root][1] for details
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

If anyone can explain the process of installing an extension with the help of composer, it will  be appreciated.


texts: products thumbnail images missing when share it any social networks

texts:
when i share products on any social networks products thumbnail images missing all time

please help me any buddy
i'm use magento 1.9.2.2

http://prnt.sc/cnrliu


texts: After upgrade from 2.0.6 to 2.1.2 no products show up, all categories are empty

texts:
I'm sure this question has been asked, but there is no answer, and now it is critical that I upgrade from 2.0.6 due to the new advisory.

I have tried several different ways to upgrade, via CLI with composer and magento:upgrade ala this guide

http://devdocs.magento.com/guides/v2.1/comp-mgr/cli/cli-upgrade.html

I have tried fresh install from scratch only using my previous database and installing with the composer.

the end result for both is a page that has the category tree, but all products do not exist, yet the product count on the side within the category tree is the full count of all products including products not in inventory.

I've done just about everything imaginable, I've reindexed, I've flushed the cache, I've verified permissions.

In the admin, I can see all of my products, and all of my categories are populated with all my products

any pointers any suggestions, I'm practically at my wit's end.


texts: Magento2 - How to remove "or" from header.links

texts:
How can I remove the or from the sign in link?
It currently says sign in or (default), and I would like to remove the or because I don't need it.
Here a screenshot of it (in german):

Any help is extremely appreciated.


texts: Can't install sampledata with Magento 2.1.3

texts:
I'm just installed Magento with the following archive :
Magento-CE-2_1_3_sample_data_tar_bz2-2016-12-13-09-29-31.tar.bz2

At the end of the install, I got this message :

Details from the logs :

/var/www/html/magento2$ cat var/log/system.log
[2017-01-05 08:17:20] main.ERROR: Sample Data error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1' for key 'PRIMARY', query was: INSERT INTO `catalog_product_entity` (`entity_id`, `attribute_set_id`, `type_id`, `sku`, `has_options`, `required_options`) VALUES (?, ?, ?, ?, ?, ?) [] []
[2017-01-05 08:22:48] main.ERROR: Sample Data error: No such entity with cartId = 1 [] []

How should I fix it ?


texts:
I have enabled free shipping with a minimum order amount of $100. When I add the product to cart with 1 quantity of $45. it works fine as it is not applied.

But It shows When i add the product of $90. However, it should have shown Free shipping when the amount is equal to $100 or above.

How to fix it?


texts: How to add created at and updated at column and update it on values save?

texts: I want to add created_at and updated_at columns in a custom table and update both columns on saving the data.


texts: Observer not save updated images gallery alt tag

texts:
i create simple module, which auto product name in images gallery alt tag

Evern :

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">

        <event name="catalog_product_save_after">
            <observer name="imagesalttags_catalog_product_save_after" instance="Vendor\Module\Observer\CatalogProductSaveAfter" />
        </event>

    </config>

call observer :

<?php

namespace Vendor\Module\Observer;

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

use Magento\Store\Model\StoreManagerInterface;

class CatalogProductSaveAfter implements ObserverInterface
{

    protected $scopeConfigObject;

    protected $_storeManager;

    protected $_request;

    public function __construct(
        \Magento\Catalog\Helper\Product $catalogProductHelper,
        \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfigObject,
        \Magento\Framework\App\RequestInterface $request,
        StoreManagerInterface $storeManager
    ) {
        $this->catalogProductHelper = $catalogProductHelper;
        $this->scopeConfigObject = $scopeConfigObject;
        $this->_request = $request;
        $this->_storeManager = $storeManager;

    }

    public function execute(Observer $observer)
    {

        $product = $observer->getProduct();

        $pname = $product->getName();

        $existingMediaGalleryEntries = $product->getMediaGalleryEntries();

        foreach ($existingMediaGalleryEntries as $key => $entry) {

                    $entry->setLabel($pname);

                }
                $product->setMediaGalleryEntries($existingMediaGalleryEntries);
                $product->save();

        return ;
    }
}

But product save is not working, continue loader is display.
Please can you help it any one know how to save product data via observer for above case


texts: How to create an order programmatically with bundle items in Magento 2?

texts:
This is my script:
    $quote = $this->quote->create();
    $quote->setStore($store);
    $quote->setCurrency();
    $quote->assignCustomer($customer);

        $product = $this->product->get($order['recipeSku']);
        $params = [
            'product' => $product->getId(),
            'bundle_option' => $this->getBundleOptions($product),
            'qty' => 1
        ];
//        $product->setPrice($product->getPrice());
        $quote->addProduct($product, $params); // the quantity will always be 1(one)

    $shippingAddress = $this->getCustomerAddress($customer->getDefaultShipping());
    $billingAddress = $this->getCustomerAddress($customer->getDefaultBilling());

    //Set Address to quote
    $quote->getBillingAddress()->addData($shippingAddress->getData());
    $quote->getShippingAddress()->addData($billingAddress->getData());

    $defaultCard = $this->getDefaultVault($customer->getId());

    $quote->setPaymentMethod(AdyenCcConfigProvider::CC_VAULT_CODE);
    $quote->setInventoryProcessed(false);
    $quote->save();

    // Set Sales Order Payment
    $quote->getPayment()->importData([
        'method' => AdyenCcConfigProvider::CC_VAULT_CODE,
        'public_hash' => $defaultCard->getData('public_hash'),
        'is_active_payment_token_enabler' => true,
        'purchase' => true
    ]);

    // Collect Totals & Save Quote
    $quote->collectTotals()->save();
    $order = $this->quoteManagement->submit($quote);
    $order->setEmailSent(0);

    public function getBundleOptions($product)
    {
        $selectionCollection = $product->getTypeInstance()
            ->getSelectionsCollection(
                $product->getTypeInstance()->getOptionsIds($product),
                $product
            );
        $bundleOptions = [];
        foreach ($selectionCollection as $selection) {
            $bundleOptions[$selection->getOptionId()][] = $selection->getSelectionId();
        }
        return $bundleOptions;
    }

How can i add some bundle options as well ? This question is somehow related to this one: Create order of 'Bundle Product' programmatically with options selection: Magento 2
Right now i m getting this message We found an invalid request for adding product to quote.
Thx in advance for any suggestions :)


texts: Productlist with all possible configurations

texts:
We are looking for a way to get a list with all possible product configurations per product and its associated price, including delivery. If the same product has a different price or options it has to be registered as a new product.

e.g.

  productName, price, sku, entityId, array(options, optionIds), delivery

  Flyer, 1.99, flyer, 1, [[small, 1], [colorful, 2]], normalDelivery

  Flyer, 2.99, flyer, 1, [[big, 3], [colorful, 2]], normalDelivery

  Flyer, 3.99, flyer, 1, [[small, 1], [colorful, 2]], fastDelivery

  Flyer, 4.99, flyer, 1, [[big, 3], [colorful, 2]], fastDelivery

We tried the following code but it doesn’t contain all possible configurations and their associated price like shown in the example above:

<?php $collection = Mage::getModel('catalog/product')->getCollection()->addAttributeToSelect('*');

Thanks in Advance.


texts:
I'm new to Magento and I would like to know how I can add a text next to the Search bar in Magento.

The search bar is placed in the right of navigation menu

Here's what I've tried :

1) created a text to be displayed in topmenu.html but appeared either in front or next to the menu but not next to the search bar

2)Created a static block and set the identifier and store view accordingly which resulted in the block appearing near the banner of the page.

3) Added to the existing static blocks in cms , which resulted near the cart button

4) Tried changing in header.phtml, page.phtml

5) used template links to find the path but couldn't exactly find it.

finally I've added the text in form.mini.phtml in catalog search, which i know isn't the best way to do.

The text appears below the search bar, and not to the right of it.

I've tried changing it in scss but it has no effect on it. Not even the font size changes. Cleared the cache too.

I'm a complete beginner so I'm not used to it. Please help me with this.


texts: Migrate customer data from magento 1.9 to magento-2?

texts: How to migrate customer data from magento 1.9 to magento-2?


texts: Magento2: Catalog search page is not working?

texts:
I am getting this search results. How to change Catalog search results Page.

When there is no results it displays fine with header and footer. When there is a results, it doesnt displays header and footer.

Anyone help me on this.


texts: How to remove account button and replace with simple account|login links

texts:
I am using my own custom version of the RWD theme and want to remove the account button with the icon next to it and replace it with two simple account|login links that go to the account login/signup page.

Can anyone tell me how this can be achieved?


texts: Magento2 - Menu Not Visible On Custom Module

texts:
Hi I have installed a new module but It's is not visible in Menu.

Here is a menu.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Backend:etc/menu.xsd">
    <menu>
        <add id="Technogex_CustomerAttribute::core" title="Technogex" translate="title" module="Technogex_CustomerAttribute" parent="Magento_Backend::stores"   sortOrder="100"  resource="Technogex_CustomerAttribute::core"/>
        <add id="Technogex_CustomerAttribute::customer_attributes" title="Customer Attribute" module="Technogex_CustomerAttribute" sortOrder="70" parent="Technogex_CustomerAttribute::core" action="customerattribute/attribute" resource="Technogex_CustomerAttribute::customer_attributes"/>
    </menu>
</config>

Please take a look someone.


texts: how to use Search rest api in magento 2?

texts:
How to get items using search rest apis,example: I want to search watch in mogento2,how can i get the data from rest apis.

Tried like this : http://localhost/magento2/index.php/rest/V1/search?searchCriteria[requestName]=watch

But i gives an error message like this:

  {"message":"Request name 'watch' doesn't exist"}.

Actually watches data is there.


texts: Is it possible to import all style from base theme into custom theme in magento 2 and how?

texts:
I have newly started working on magento 2 .

I have created custom theme by keep luma theme as parent. I want to import all css of parent theme in custom theme of magento 2.


texts: Magento 2.3 : Get category attribute by store wise

texts:
I have used below code to get attribute value,

$category = $this->registry->registry('current_category');
$external_url = $category->getData('attribute_code');

How to get it by store wise?

Any help would be appreciated.


texts: How To Display Sub Category On Sub Category Pages

texts:
How To Display Sub Categories On Sub Categories Pages . For Example I have categories Like

1) HIS
 - Wallets
 -  Belts

2) HER
 - Wallets
 - Nighty
 - Handbag

When the user selects the wallets all the sub categories should be shown on the left


texts: How to check user is logged in or not on non secure pages (http) if SSL (https) is active?

texts:
In header.phtml file using

Mage::getSingleton('customer/session')->isLoggedIn()

we can check user is logged in or not.

If SSL is active on frontend then above function works fine if accessing page using https request but for all non secure pages using http request it fails.

How we can check user is logged in or not on all pages ie with http and https request in header.phtml?


texts: how to create aroundplugin for abstractentity?

texts:
I have created around plugin for isAttributeValid function for Magento\ImportExport\Model\Import\Entity\AbstractEntity but it is not working.
code:
<type name="Magento\ImportExport\Model\Import\Entity\AbstractEntity">
 <plugin name="bbb" type="xxxx\yyy\Plugin\Entity\AbstractEntity" sortOrder="10" />
</type>

in the plugin:

<?php
namespace XXX\YYY\Plugin\Entity;

class AbstractEntity
{
    public function aroundIsAttributeValid(
        $subject, $attrCode, $result) {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log');
        $logger = new \Zend\Log\Logger();
        $logger->addWriter($writer);
        $logger->info('hhhuu');
        echo "hhh";exit();
        $returnValue = $subject;
        return $returnValue;

    }

}

but echo is not printed.


texts:
i have some trouble when i run command php bin\magento setup:static-content:deploy

it always keep missing permission when create new folder even after i assign full permission (i'm using windows) and tick 'apply to subfolder and files', this permission is not inherited in new folder

is this some bug on magento and is there any way to fix this?

PS: my magento is on dev server which is running CentOs and my local computer is running windows 7


texts: Trying to create configurable product, error product id already exists

texts:
When I try to create an configurable product I get the following error:

Item (Mage_Catalog_Model_Product) with the same id "3941" already exist

I can't find the problem. Creating a simple product does not have this problem. Is there a seperate auto_increment for configurable products? Any body any idea how to get around this problem.


texts: Magento 1: How to check image file is uploaded or not without using Global variable $_FILES()?

texts: Is there any way to check that image file is uploaded or not without use of $_FILES() ? in Magento 1.9.4.0


texts: Hide link navigation customer account on specific condition

texts:
I'm would like to know if it's possible to hide a navigation link of the Customer Account dashboard depending on a condition.
For example, I would like to display this block only if customer has a specific account:

Is it possible ? Does anyone can help me ?
Thank you for any advice


texts: Magento Enterprise Cloud Edition: What are the development and deployment tools?

texts:
The new PaaS solution of Magento Enterprise 2 has just been released, "Magento Enterprise Cloud Edition". Other than with Magento Go, you have full access to the source code and you can do whatever is possible with Magento EE. As I understand it, the cloud edition is a set of pre-built tools and configurations on top of AWS:

(Image: https://magento.com/products/enterprise-cloud-edition)

Now my question is, which third-party tools, if any, are used for:

Continuous Integration
Rapid Deployment
Dev Life Cycle Management
Environment Management

And if it's all proprietary, will it be possible to integrate other systems as replacement, for example, if we have an existing Jenkins or Bamboo setup for CI?


texts: Custom Canonical Tag in Magento 2 Category with Magework seosuite

texts:
I try to show custom canonical for category with Magework seosuite, but this function I think that not is possible.
Is there a way to do this, maybe with an extension or plugin of this module ? Thank in advance.  ( Magento 2.3.2)


texts: Magento 2 "Attention Something Went Wrong" Clicking Content>Blocks; Page Doesn't Load Correctly

texts:
I am using Magento 2.0.4, and whenever I click on Content>Elements>Blocks I receive the following error message:
"Attention Something went wrong."

There is no more information, and after clicking OK it goes to the CMS Blocks page with the loading circle, and never stops loading. I am able to click on Add New Block button, and then create and save a new block, but those newly created/saved blocks do not show up in the Blocks page because it never fully loads.

Relevant Platform Install Info (can edit with more if needed): Magento version 2.0.4, PHP version 5.6.20

Browsers I've tested this issue on: Firefox 45.0.1, IE 11.0.9600.18231, Chrome 49.0.2623.110

This is a Magento install directly from the magentocommerce website, and not any kind of github download. After upgrading from Magento 2.0.2 to Magento 2.0.4 I already flushed everything, deleted static content, and ran the command to redeploy static content.

Please let me know what I'm missing here. Is this a permissions issue on the back end somewhere?, a coding issue, a known issue, or what is going on? I don't seem to be getting this error message when I click on anything else in the Admin Panel (for example, Pages, Themes, Widgets, and more all load correctly and generate no error message).


texts:
I want to create new route, ex:brand

I tried to access www.myPage.com/brand and www.myPage.com/index.php/brand

But it just shows 404 page not found after I create this scripts bellow.

This is my IndexController.php scripts :

<?php

class MyWeb_Brand_IndexController extends Mage_Core_Controller_Front_Action
{
    public function indexAction()
    {
        echo 'Hello developer...';
    }

    public function sayHelloAction()
    {
        echo 'Hello one more time...';
    }
}
?>

My config.xml scripts :

<?xml version="1.0"?>

<config>
    <modules>
        <MyWeb_Brand>
            <version>0.1.0</version>
        </MyWeb_Brand>
    </modules>
    <frontend>
        <routers>
            <MyWeb_Brand_Route>
                <use>standard</use>
                <args>
                    <module>MyWeb_Brand</module>
                    <frontName>brand</frontName>
                </args>
            </MyWeb_Brand_Route>
        </routers>
    </frontend>
</config>

And this my app/etc/modules/myWeb_Brand.xml file:

<?xml version="1.0"?>

<config>
    <modules>
        <MyWeb_Brand>
            <active>true</active>
            <codePool>local</codePool>
        </MyWeb_Brand>
    </modules>
</config>


texts: My checkout got a width of 1500%, how do UI library grid make sense here?

texts:
After upgrading to Magento 2.3.2 and using the latest Magento, the <div class=".opc_wrapper"> in our checkout got a width of 1500% making it ugly.

We are actually using https://github.com/SnowdogApps/magento2-theme-blank-sass as a theme, so the issue might come from there. Anyways, I digged that down and compared with the less theme and it boils down to this:

In checkout.less L134

.opc-wrapper {
    &:extend(.abs-add-box-sizing-desktop-m all);
    .lib-layout-column(2, 1, @checkout-wrapper__columns);
    padding-right: @indent__l;
}

@checkout-wrapper__columns equals to 8 a bit earlier in the file

If I remove the .lib-layout-column, the width: 1500% is not set, so it is coming from there.

Going down the rabbit hole, after some strange looping construct in  brings us finally to the [grids LESS file][3], which (in the SASS version) calculates a width of 1500%.

Sure this is not a core bug, because we use a custom theme.

But in order do debug the issue, I need to understand, what the core blank theme is trying to accomplish there.

My understanding of

.lib-layout-column(@_total-columns, @_order, @_width) {

is, that I specific the width in number of columns?

So if I call that with total-columns = 2
order = 1 (what is that for?)
and the width parameter of 8, it kind of makes sense that this becomes super wide.

And this is already in the core's blank theme.

So what is going on there? How is lib-layout-column to be used?


texts: Magento2.3: How to display the register link in my custom module?

texts:
I want to display the Login and Register link in one of my custom module. I have got a solution for displaying the Login link by giving the below code in block file:

public function checkCustomerLogin()
    {
        $customer_data = [];
        if (!$this->_customerSession->isLoggedIn()) {
            $customer_data['text'] = "Login";
            $customer_data['url'] = $this->_storeManager->getStore()->getUrl('customer/account/login');
        } else {
            $customer_data['text'] = "Logout";
            $customer_data['url'] = $this->_storeManager->getStore()->getUrl('customer/account/logout');
        }
        return $customer_data;
    }

But I haven't got a solution for displaying the register link.

Could anyone please help me to resolve this issue?


texts: I am getting Cannot read property 'sectionLoadUrl' of undefined in particular form in magento 2.3.0

texts:
This getting this error on a particular form in Magento 2.3.0. I think this error causes invalid form key sometimes when submitting the form. How to solve this following error.

Uncaught TypeError: Cannot read property 'sectionLoadUrl' of undefined
    at Object.getFromServer (customer-data.js:90)
    at Object.reload (customer-data.js:333)
    at UiClass.initialize (minicart.js:105)
    at UiClass.initialize (wrapper.js:109)
    at new UiClass (class.js:49)
    at Object.initComponent (layout.js:137)
    at fire (jquery.js:3232)
    at Object.fireWith [as resolveWith] (jquery.js:3362)
    at Object.deferred.<computed> (jquery.js:3461)
    at fire (jquery.js:3232)


texts: Magento 2 - Adding custom layout handle for layouts (1 column, 2column etc) set via product admin page

texts:
I want separate layout handles defined for products dependent on their layout  set via the layout options for product within admin (1 column, 2 column left, 2 column right).

I need to set additional instructions to move and remove blocks based on the layout set. For example set a product to 1 column and update the catalog_product_view_layout_1column.xml file to remove blocks.

I have tried with both an observer and plugin to try and set this additional handle however am having difficulty. Below is how I tried to achieve with plugin method:

<type name="Magento\Catalog\Helper\Product\View">
    <plugin name="Vendor_Module_LayoutMods" type="Vendor\Module\Plugin\LayoutMod" />
</type>

  di.xml

<?php

namespace Vendor\Module\Plugin;

class LayoutMod
{
    public function aroundinitProductLayout(
        \Magento\Catalog\Helper\Product\View $subject,
        callable $proceed,
        \Magento\Framework\View\Result\Page $resultPage,
        $product,
        $params = null
    ) {
        $result = $proceed($resultPage, $product, $params);
        $resultPage->addPageLayoutHandles(['layout' => $product->getData('page_layout')], 'catalog_product_view');
        return $result;
    }
}

  plugin/LayoutMod.php

This seems to add the handle in that $resultPage->getLayout()->getUpdate()->getHandles() shows my new custom handle catalog_product_view_layout_1column catalog_product_view_layout_1column.xml does not seem to be processed.  catalog_product_view_id_123.xml does work however fine and blocks are removed. My xml is currently pretty simple as I test:

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <attribute name="class" value="my-css-class"/>
        <referenceBlock name="product.info.main" remove="true"/>
    </body>
</page>

  Magento_Catalog/layout/catalog_product_view_layout_1column.xml

I'm wondering can help explain why my new handle is not working?


texts:
I tried,

I got current url -

$current_url =  $this->_storeManager->getStore()->getBaseUrl();

In phtml file I called parameter

<a href="<?php echo $current_url."test/param/1"; ?>">Test

Page not found 404 error I am getting.

Link is working perfectly but while passing parameter it is giving 404 error.


texts: Can't save customers after migration Magento 2

texts:
After I migrated from Magento 1.9.3.8 to 2.2.5 although I can create new customers I can't edit and save the migrated ones. In admin I get errors that First Name, Last Name and other attributes are needed. But in customer these fields are filled.
In

system.log

I get:
[2019-02-16 12:55:39] report.WARNING: Attempt to load value of nonexistent EAV attribute '1163'
                        for entity type 'Magento\Catalog\Api\Data\ProductInterface'. [] []
[2019-02-16 12:55:39] report.WARNING: Attempt to load value of nonexistent EAV attribute '1206'
                        for entity type 'Magento\Catalog\Api\Data\ProductInterface'. [] []

and
[2019-02-16 12:57:27] report.INFO: Broken reference: the 'notification.messages' tries to reorder itself towards 'user', but their parents are different: 'header.inner.right' and 'header' respectively [] []

I managed to removed the mentioned attributes which were product attribute. As continue investigation my problem is a Magento 2.2.5 bug or because in Magento 1.9.3.8 was using Amasty customer attributes extension, these customer attributes were migrated to Magento 2 and created this problem.
When I save a migrated customer in admin I get:

"First Name" is a required value.
"First Name" length must be equal or greater than 1 characters.
"Last Name" is a required value.
"Last Name" length must be equal or greater than 1 characters.
"Street Address" is a required value.
"Street Address" length must be equal or greater than 1 characters.

But all these fields are correctly filled.
Can anyone help me what to check please?
I am going crazy here...


texts:
I've created a 2.2.4 magento website a few month ago. My client wanted to clone this website, in order to have 2 different databases but keep all the fonctionnalities.
So I've cloned this website, updated the catalog etc...
Everything works fine, except the catalog research. I'm having a blank page each time I do the search.
I saw nothing in the php, apache, mysql or magento log (system or debug)...
This is the source code that I have :

EDIT : after digging into my log, those error are thrown but not on the search page (so, I guess it's stopping before). This is similar to another issue, I tried removing some block in my Magento_Theme::default.xml file, but I still have the white screen...


texts: Sign in Not show in front side after update Magento 2.3.3

texts:
Guy's I have one issue in the Magento 2.3.3 store after update.

before the update Magento sign-in option show in header top links

Like this https://prnt.sc/q3nll4

but right now see like this https://prnt.sc/q3nm3v

Please give me a solution where file I can check or change.

So Please help ASAP


texts: Magento2: Apply coupon code to regular price not to special price

texts:
When applying a coupon, it gives a discount to final price (special price if set). How to make modification that discount would apply only to regular prices (before the previous discount).

Note: I don't want to exclude discounted items from the cart.

For instance, I have a discounted product which regular price is 30€ (special price 25€). I apply a coupon which gives a fixed 10€ discount. Final price becomes 15€. It should become 20€.

I've tried not to use special prices on products and set discounts in Catalog Price Rule. Then set Discard subsequent rules on the coupon to Yes expecting that Cart Price Rule would ignore Catalog Price Rule. But it doesn't.

The solution could be to make a module for a custom discount like https://webkul.com/blog/set-custom-discount-fee-cart-magento-2/ described. But how to get the regular price? and applied coupon name is needed to know, too.


texts: It is showing like this. option value not showing in configurable product.


texts: How can i merge 4 module having almost same functionalities except their same collection with different filters as well as little bit design changes

texts:
I have developed four modules. In that All the modules having almost same functionality of showing list from sales_flat_order table with different filters. It has some changes in design like on extra column in design table. that's it.

To remove redundancy of code, I want to merge my all that modules in one module. Is it correct way i am thinking in or i should put it as it is?

What are the ways in which i can optimize my code and reduce the level of redundancy in my code.

Thanks in advance.!


texts:
I need to add Tracking code to Magento.

  Put in the < BODY> section on all store pages the code:

  On Order sucesfull page / Confirmation page to submit the transaction in the < BODY> section put the script:

Anyone help in which files should I put these codes to work properly?


texts:
Can anyone please tell me How to Get order increment id using order id in Magento 2?

Thanks.


texts: How to check if there are recently viewed products

texts:
I need to do a check if there is any recently viewed product and if so, then need to display some text.

Does anyone know, how to check if there are recently viewed products?


texts: Magento 2 Product Collection: Invalid argument supplied for foreach()

texts:
I get product collection using dependency injection rather than directly using object Manager, this is the way most people suggest, but when I visit the product collection template, it shows:

Error filtering template: Warning: Invalid argument supplied for foreach() in .../xxx.phtml

How to fix it?

The codes I used is most people suggest like below. I guess the codes could has some tiny mistake which I did not find.

In block:

<?php
namespace Vendor\HelloWorld\Block;
class HelloWorld extends \Magento\Framework\View\Element\Template
{
    protected $_productCollectionFactory;

    public function __construct(
        \Magento\Backend\Block\Template\Context $context,
        \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory,
        array $data = []
    )
    {
        $this->_productCollectionFactory = $productCollectionFactory;
        parent::__construct($context, $data);
    }

    public function getProductCollection()
    {
        $collection = $this->_productCollectionFactory->create();
        $collection->addAttributeToSelect('*');
        $collection->setPageSize(3); // fetching only 3 products
        return $collection;
    }
}
?>

In template (.phtml) file:

$productCollection = $block->getProductCollection();
foreach ($productCollection as $product) {
    print_r($product->getData());
    echo "<br>";
}


texts: Transaction Emails Magento 1.9.0.1 AWS and Amazon SES

texts:
I am working on a magento store which is installed on AWS EC2. I have setup Amazon SES to handle email and I installed the extension aschroder SMTP which supports Amazon SES. Using this system I am able to successfully send out the test email using the SMTP extension connected to my SES account. When I place a test order I am able to add a comment which immediately sends the comment email out to the customer. But the customer never receives the order emails. Even if I manually click the Send Email button on the order it never arrives.

I have searched the internet for days looking for solutions. I have made sure my SES account is no longer in sandbox mode, checked to ensure all of my cron tasks are working correctly. This has me stumped. Any help would be greatly appreciated.


texts: Magento 2 Fatal error after saved Category Custom Image Attribute

texts:
I've added a custom image attribute to my category with Magento 2 Module Generator from https://mage2gen.com/ (Magento version 2.2)
Everything is perfect, but when I upload an image to the attribute and save category, an error occurred:

  Fatal error: Method Magento\Ui\TemplateEngine\Xhtml\Result::__toString() must not throw an exception, caught Error: Cannot use string offset as an array in C:\xampp\htdocs\magento2\vendor\magento\module-ui\Component\Wrapper\UiComponent.php on line 0

This is my InstallData.php

<?php
namespace Vendor\Module\Setup;

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

class InstallData implements InstallDataInterface
{
    private $eavSetupFactory;
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public function install(
        ModuleDataSetupInterface $setup,
        ModuleContextInterface $context
    ) {
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);

        $eavSetup->addAttribute(
            \Magento\Catalog\Model\Category::ENTITY,
            'thumbnail_image',
            [
                'type' => 'varchar',
                'label' => 'Thumbnail Image',
                'input' => 'image',
                'sort_order' => 5,
                'source' => '',
                'global' => 0,
                'visible' => true,
                'required' => false,
                'user_defined' => false,
                'default' => '',
                'group' => 'General Information',
                'backend' => 'Magento\Catalog\Model\Category\Attribute\Backend\Image'
            ]
        );

     }
}

And the category_form.xml

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
<fieldset name="general">
    <field name="thumbnail_image">
        <argument name="data" xsi:type="array">
            <item name="config" xsi:type="array">
                <item name="required" xsi:type="boolean">false</item>
                <item name="validation" xsi:type="array">
                    <item name="required-entry" xsi:type="boolean">false</item>
                </item>
                <item name="sortOrder" xsi:type="number">5</item>
                <item name="dataType" xsi:type="string">string</item>
                <item name="formElement" xsi:type="string">fileUploader</item>
                <item name="label" translate="true" xsi:type="string">Thumbnail Image</item>
                <item name="uploaderConfig" xsi:type="array">
                    <item name="url" path="catalog/category_image/upload" xsi:type="url"/>
                </item>
                <item name="elementTmpl" xsi:type="string">ui/form/element/uploader/uploader</item>
                <item name="previewTmpl" xsi:type="string">Magento_Catalog/image-preview</item>
                <item name="source" xsi:type="string">category</item>
            </item>
        </argument>
    </field>
</fieldset>

I am sure the value is saved OK (checked in database for eav_attribute, catalog_category_entity_varchar tables) and the image is uploaded into \pub\media\catalog\category

Thanks for any help!


texts: How to detect if the store is using developer mode via browser?

texts:
I usually do some store audits even without ssh access, and I'd like to be more precise checking if the store is using developer mode just browsing through the browser console.

How could I check if the store is using the developer mode instead of production mode without server access, just using my browser?


texts:
On Magento 2.4 i found this class extends (extends \Magento\Framework\App\Action\Action) show deprecated.
Ref : Screenshot at end of the question
But Magento core use this code. I mean in core code they extends this class.
As per knowledge if a code get deprecated then on next release it may get removed, so there must be alternative code for the deprecated code. How can we easily found alternative for list of deprecated code in Magento 2?


texts: Magento2 how to apply layered navigation filters at REST API Level?

texts:
I would like to implement below REST API in magento 2

  "How to retrieve which layered navigation filters are applied as like
  in the product list page?"

Can you please suggest me how we can achieve (or) possibilities?

In magento 1 at website level we can get applied filters at list page (list.phtml) by following snippet

  $appliedFilters =
  Mage::getSingleton('catalog/layer')->getState()->getFilters();

(and)

  $appliedFilters =
  Mage::getSingleton(‘Mage_Catalog_Block_Layer_State’)->getActiveFilters();

But in magento 2 at api level how we can implement ?


texts: How to log in an admin user programmatically from frontend controller in Magento 2

texts:
I'm working on implementing a SSO solution in Magento 2 for the admin side. Once the SSO authentication is complete I want to be able to log in the user from the frontend controller endpoint and redirect them to the admin dashboard.

Here is how I'm setting the auth session from the frontend controller action:

// I've verified this user model is valid and has a valid role.
$model = $this->userFactory->create()->load($sso_user['email'], 'email');
/** @var \Magento\Framework\App\State $appState */
$appState = ObjectManager::getInstance()->get('Magento\Framework\App\State');
$appState->emulateAreaCode('adminhtml', function ($model) {
  /** @var \Magento\Backend\Model\Auth\Session $session */
  $session = ObjectManager::getInstance()->get('Magento\Backend\Model\Auth\Session');
  $session->start();
  $session->setUser($model);
  $session->processLogin();
  // If I call `$session->isLoggedIn()` at this point it returns TRUE.
}, array($model));

Then I'm getting the $backend_url and it returns "adminhtml/dashboard"

$backend_url = '';
/** @var \Magento\Framework\App\State $appState */
$appState = ObjectManager::getInstance()->get('Magento\Framework\App\State');
$appState->emulateAreaCode('adminhtml', function () use (&$backend_url) {
  /** @var \Magento\Backend\Model\Url $url_model */
  $url_model = $this->_objectManager->get('Magento\Backend\Model\Url');
  $backend_url = $url_model->getStartupPageUrl();
}, array());

/** @var \Magento\Backend\Model\View\Result\Redirect $resultRedirect */
$resultRedirect = $this->resultRedirectFactory->create();
$resultRedirect->setPath($backend_url);
return $resultRedirect;

However, once the redirects happens, it instead takes me to the admin login page. Am I not setting the admin user session correctly or is it something to do with attempting to redirect to a backend url from the frontend? Or something else I'm missing? Thanks for any help!


texts: installation of patch supee-5344 for magento 1.5.1.0

texts:
I am using magento 1.5.1.0 and I want to install patch  SUPEE-5344. When I check the download page of magentocommerce.com I can only find the patch for Magento-CE-v1.4.0.x-1.5.0.x

Will this version support version 1.5.1 ? or does it only support up to version 1.5.0.x ?

Thanks for your input


texts:
I created a phpinfo.php page in my Magento2 project but when I try to access it via URL it shows a 404 page.

It's set up here in the magento root:

|-Magento2
|-----<other folders etc.>
|-----phpinfo.php

url I try to go to: site.local/phpinfo.php - returns 404

I tried running all the commands but still 404s.. is it something with routing that's preventing me from just accessing a file normally?

Edit: my phpinfo code:

<?php
    phpinfo();


texts: I changed base url to an address, then changed it back but it keeps jumping to the one I changed!

texts:
Sorry if this sounds confusing this is what happened:

I was working on a Magento version on this server, and thought the guy was going to transfer the domain name to point back here. So I went to configuration and changed the base url and the base secure url to the new domain.

I found out the domain isn't ready until Monday! So I went to myPHPadmin and went into core_config_data and changed the url back to the old one so I can continue working on it

Problem is now the site keeps forwarding to the new domain! I checked my core config data and its pointing to my old domain... I even did a database restore and same problem!

What file am I missing to edit?


texts: Magento2 : How to send a request for a page and get the page status?

texts:
I want to check if the status of the page is not 200, then add it to the array along with the status and send it to the mail at the end of the script
I can't finish the code, tell me how to implement it. My code stops working on the line $this->curl->get($url);
<?php

namespace Modules\Test\Cron;

class Test
{
    protected $curl;

    private $logger;

    public function __construct(
        \Psr\Log\LoggerInterface $logger,
        \Magento\Framework\HTTP\Client\Curl $curl
    ) {
        $this->logger = $logger;
        $this->curl = $curl;
    }

    public function execute(): void
    {
        $urls = [
            'http://example.com/one',
            'http://example.com/two',
            'http://example.com/three'
        ];

        $problemUrls = [];

        $this->curl->setCredentials('basicLogin', 'basicPass');

        foreach ($urls as $url) {
            try {
                $this->curl->get($url);
                $response = $this->curl->getHeaders();
                if ($response === 404) {
                    array_push($problemUrls, $url);
                }

                if (!empty($problemUrls)) {
                    mail('test@gmail.com', 'test@gmail.com', var_export($problemUrls, true));
                }
            }
            catch (\Exception $e) {
                $this->logger->critical('Error Curl', ['exception' => $e]);
            }
        }
    }
}


texts: how I can limit the maximum selectable simple products?

texts:
Hi can you help me for limit multiple checkbox selections?

I have create a bundle product with 100 simple products, how I can limit the maximum selectable simple products to 10 or 20 or other value recorded as custom attribute into bundle product?

Please help me

Thank you in advise


texts:
I have a few links(containing image and title) to some of my store's pages, this can be a filtered search page, or a category page or any other URL.
I want to manage these link from an static block in a way that admin doesn't have to deal with html coding.

For example, I want them to enter something like this:
{{image_url="/images/blahblah.jpg" href="http://mystore.com/accessories.html?price=-100" title="Accessories under $100"}}

And I want to render each item like below:

Accessories under $100

               Show all products

Any suggestions on how this can be done is highly appreciated.


texts: Using chinese characters in base_url - how to edit regex in Http.php to allow valid() to pass?

texts:
for a multi-site setup we are about to launch a chinese store, which has chinese characters in the base url.
Howeverer, using .htaccess to load the correct store view, we receive a "Invalid URI supplied" error log and it also crashes the english view for that store, even though the english view doesn't have any chinese characters in the base_url.

Does anyone know what the problem is?

We are using 1.9.1 CE

Here is what I tried in the htaccess:

EDIT:

I've tried various modules, but all only seem to support url keys for products, categories and cms, but none seemt o address to the base_url issue.

I've tried this module: https://github.com/Minglong/Magento-unicode-URL

and I've also tried this: http://killerwhalesoft.com/blog/magento-unicode-url-key-products-categories-cms-pages/

Sorry, but some recent changes on StackExchange suddenly does not allow me to use chinese characters in the body Body cannot contain -insert-chinese-symbol-.

Please see this link for full code info ..

http://goo.gl/1aoSkF

Can anyone help identify the error with the above trace? Could the error come from the _checkBaseUrl function in /core/Mage/Core/Controller/Varien/Front.php ?

EDIT 2:

Ok, so I've tried to analyse the lib/Zend/Uri/Http.php file and I placed a log output in the valid() function to see which throws the error. According to the log
The error seems to come from the validatePath() function.

When logging with this function I receive the following:

2015-08-17T08:52:40+00:00 DEBUG (7): path : /-chinese-chars-here-/shop/
2015-08-17T08:52:40+00:00 DEBUG (7): pattern : /^(?:\/(?:(?:%[[:xdigit:]]{2}|[A-Za-z0-9-_.!~*'()\[\]:@&=+$,;])*)?)+$/
2015-08-17T08:52:40+00:00 DEBUG (7): status : 0

So I need to edit the regex values so it allows chinese vars - specifically this part of the __construct() function in Http.php:

const CHAR_ALNUM    = 'A-Za-z0-9';
const CHAR_MARK     = '-_.!~*\'()\[\]';
const CHAR_RESERVED = ';\/?:@&=+$,';
const CHAR_SEGMENT  = ':@&=+$,;';
const CHAR_UNWISE   = '{}|\\\\^`';

To make this validation work:

        // Escaped special characters (eg. '%25' for '%')
    $this->_regex['escaped']    = '%[[:xdigit:]]{2}';

    // Unreserved characters
    $this->_regex['unreserved'] = '[' . self::CHAR_ALNUM . self::CHAR_MARK . ']';

    // Segment can use escaped, unreserved or a set of additional chars
    $this->_regex['segment']    = '(?:' . $this->_regex['escaped'] . '|[' .
        self::CHAR_ALNUM . self::CHAR_MARK . self::CHAR_SEGMENT . '])*';

    // Path can be a series of segmets char strings seperated by '/'
    $this->_regex['path']       = '(?:\/(?:' . $this->_regex['segment'] . ')?)+';

    // URI characters can be escaped, alphanumeric, mark or reserved chars
    $this->_regex['uric']       = '(?:' . $this->_regex['escaped'] . '|[' .
        self::CHAR_ALNUM . self::CHAR_MARK . self::CHAR_RESERVED .

    // If unwise chars are allowed, add them to the URI chars class
        (self::$_config['allow_unwise'] ? self::CHAR_UNWISE : '') . '])';


texts:
I am having trouble while printing multiple images in pdf document , the following code i am using to print the image on pdf , it always printing the last order's image, lets say i have 3 orders , the id of the order is 0000001,0000002,0000003 , now in foreach loop in every iteration it prints the last order id's image 0000003. although my code is in loop

foreach ($orders as $order)
    {
    /* Barcode start here */

        $image = Mage::helper('barcode/barcode')->createOrderBarcode($order->getRealOrderId());
        if (is_file($image)) {
                    //Barcode width
                    $barcode_width = 115; //set default
                    $barcode_height = 40; //set default
               $image = Zend_Pdf_Image::imageWithPath($image);
                    //order padding left
                    $padding_left = 0; //set default
                    //order padding top
                    $padding_top = 0; //set default
                 // BOTTOM RIGHT
                    $top = 805;
                    $left = 382 - $padding_left;
                //image, left, top, width, height
                $barcode_top = $top - $barcode_height ;
                // $barcode_top = $top - $barcode_height + 6;
                $pdf->drawImage($image, $left, $barcode_top, $left + $barcode_width, $top);
            }
    /* Barcode ends here */
    }


texts:
I need to create a custom module to add an extra PDF to credit memo. The idea is to have and extra button near "Print" button, called "Print custom PDF" in the credit memo admin interface and when I click on it to export a custom PDF. It can be created via file because it is used only for internal usage.
What I actually need is to have 2 PDF for credit memos, one for customers and one for admin with different layout and data.
How can I do this?


texts: how to add js in custom module layout xml file

texts:
I want to add js in my custom module layout xml file
Below is my code:

<reference name="head">
   <action method="addJs"><script>varien/provfvfvfvf.js</script></action>
</reference>

I have added js but I wont be able to see this js in my module pages.
Whats the thing which I m missing please let me know


texts: Magento 2 how to disable My Requisition Lists from general customer in my account?

texts: I want to display My Requisition Lists only for company and B2B user and want to hide My Requisition Lists from the general customers[B2C] from my account section. How can I get this functionality in Magento2.3.4?


texts:
all of a sudden my page layout just completely broke!  I was working on a file in app/design/frontend/mytheme/default/template/catalog/product/view/media.phtml But I don't think it should cause the entire layout of site to break.  Also I re-uploaded a backup I made of that page and it didn't change the site back.  Any ideas on how to troubleshoot this?  in my error log it says

(): Entity: line 1: parser error : Start tag expected, '<' not found  in /www/sites/www.wishack.com/files/html/app/code/core/Mage/Core/Model/Layout/Update.php on line 444
2014-01-27T21:26:05+00:00 ERR (3): Warning: simplexml_load_string(): ye<?xml version="1.0" encoding="UTF-8"?>  in /www/sites/www.wishack.com/files/html/app/code/core/Mage/Core/Model/Layout/Update.php on line 444
2014-01-27T21:26:05+00:00 ERR (3): Warning: simplexml_load_string(): ^  in /www/sites/www.wishack.com/files/html/app/code/core/Mage/Core/Model/Layout/Update.php on line 444

I checked line 444 in that file and it looks normal...

Thanks for any help you can provide


texts: Magento 2 | When to use referenceContainer and when referenceBlock?

texts:
I am getting same output if I use

  referenceContainer

or

  referenceBlock

As

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceContainer name="order_totals">
        <block class="VendorName\ModuleName\Block\Sales\Totals" name="fee_amount" as="fee_amount"/>
    </referenceBlock>
</body>
</page>

And

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
    <referenceBlock name="order_totals">
        <block class="VendorName\ModuleName\Block\Sales\Totals" name="fee_amount" as="fee_amount"/>
    </referenceBlock>
</body>
</page>

Layout File is:

VendorName\ModuleName\view\frontend\layout\sales_order_view.xml

I am curious, which is recommended to use. If both can work, then on what specific conditions?
I understand basic of container as explained  here.


texts: How to resize pictures from list page on Magento 2

texts:
I tried to set the product pictures from category page to 800x800 px and i can't.

Be default the picutres size is 270x270 px;
I changed in view.xml the values for this fields into 800x800 px but nothing happend.

<image id="category_page_grid" type="small_image">
                <width>800</width>
                <height>800</height>
            </image>
            <image id="category_page_list" type="small_image">
                <width>800</width>
                <height>800</height>
            </image>

Does anyone know how can i do this?