texts: How to integrate Paypal Express Checkout with the Magento API

texts:
I am building a custom store using the Magento APIs. Everything upto shipping is working, but I'm stuck at billing.

I have enabled the Check/Money Order payment method and thats working fine. But I need to integrate Paypal Express Checkout in my custom store.
I have configured Paypal Express Checkout option as needed in the Payment Methods configuration section.
The cart_payment.list API call is only returning 'Check/Money Order' as the available payment method.
The Paypal Express Checkout option is not returned.

Is it possible to somehow list the Paypal Express Checkout option as well in the cart_payment.list API call response?

[ { code: 'checkmo', title: 'Check / Money order', ccTypes: null } ]

As you can see, it returns Check/Money Order with a code checkmo. I need to know the code for Express Checkout.

Any help is appreciated.


texts:
After upgrade magento 2.1.8 to 2.2.2 getting error :  Unable to unserialize value.

   Exception #0 (InvalidArgumentException): Unable to unserialize value.

   Unable to unserialize value. {"exception":"[object]
   (InvalidArgumentException(code: 0): Unable to unserialize value. at /home/prabhsim/public_html/grittyearth.com/vendor/magento/framework/Serialize/Serializer/Json.php:39)"}


texts: Magento 2.4 is this possible bypass Elasticsearch?

texts:
i have upgraded magento 2.3.4 to 2.4.0 but when I run compile command, it's showing an error

Error:
  Compilation was started.
Area configuration aggregation... 5/8 [=================>----------]  62% 34 secs 340.0 MiB
In ClassReader.php line 43:

  Class Magento\Framework\Search\Adapter\Mysql\Mapper does not exist

In ClassReader.php line 36:

  Class Magento\Framework\Search\Adapter\Mysql\Mapper does not exist

I want to use mysql instead of elastic search


texts: Magento2 - How to remove item from wishlist?

texts: I want to remove an item from wishlist in magento2 with  wishlist id or wish list item id, how can do that ?


texts: 'Only X left Threshold' for each product (not globally)

texts:
I would like to show 'Low Stock Notification' on my website.
I have set 'Only X left Threshold' globally.
Is there any possibility to set this for each product individually?


texts:
For a company we are looking for an extension which allows us to show a map of one country. Within this map a site visitor can either enter his zip code or city. Once filled in the nearest locations will be shown. Sort of like Subway does (https://order.subway.com/Stores/Find.aspx#pg1).

Clicking on a location the prices and products belonging to that specific location are shown.

Hope someone can help me figure out if there is an extensions within Magento 1 or 2 for this?


texts: Setting a product to in-stock raises foreign key exception

texts:
When executing the following:

$product = Mage::getModel('catalog/product')->load($id);
$stock_item = $product->getStockItem();
$stock_item->setIsInStock(true);
$stock_item->save();
//...other product edits...
$product->save();

For a very small amount of products (~13 or so) in the store (~10k SKUs) the following exception is raised:

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`magento`.`cataloginventory_stock_item`, CONSTRAINT `FK_CATINV_STOCK_ITEM_STOCK_ID_CATINV_STOCK_STOCK_ID` FOREIGN KEY (`stock_id`) REFERENCES `cataloginventory_stock` (`stock_id`) ON DE...

Again, this is a very small number of items many of which are defunct. There have been no manual db edits, but, I'm curious if there are others that have this issue that I don't/won't know about. Is there a way to handle this or to rectify this at the db level?


texts: how to pass dynamic values in knockout js template file?

texts:
Please look at https://github.com/sivajik34/Delivery-Signature-Magento2.

app/code/Kensium/DeliverySign/view/frontend/web/template/checkout/shipping/delivery-signature.html

<input type="checkbox" name="delivery-signature" value="delivery-signature"> $5.00Delivery Signature

How to make $5 value as dynamic from config.I think I'm almost near to solution.but i have no proper idea on knockout.js

can you please help me on this?


texts:
I have a custom product collection.

$collection = Mage::getModel('catalog/product')->getCollection()
                    ->addFieldToFilter('entity_id', array('in' => $ids));

The products have only some attributes set like: entity_id, entity_type_id, attribute_set_id, type_id, sku, created_at, updated_at, is_salable, stock_item (is an object).
Also for more attributes I can add the method

->addAttributeToSelect(array('name'))

I noticed, that if I don't add the status field to the collection using the method above, then if I want to see if the products from the collection can be bought using isSaleable it will return true because in Mage_Catalog_Model_Product

public function getStatus()
{
    if (is_null($this->_getData('status'))) {
        $this->setData('status', Mage_Catalog_Model_Product_Status::STATUS_ENABLED);
    } ...

and in Mage_Catalog_Model_Product_Type_Abstract

public function isSalable($product = null)
{
    $salable = $this->getProduct($product)->getStatus() == Mage_Catalog_Model_Product_Status::STATUS_ENABLED; ...

Is this a bug? Do I always need to add the status field to the collection? Does anyone know of any other fields you have to add to the collections because of Magento's logic?
Why didn't they force the status to be added in a core observer on before collection load?


texts: Magento 1.x: Copy System Configuration (core_config_data) values from a website to another

texts:
I have a magento website having three websites: web1, web2 & web3

I need to set all system configuration values from web2 to another new website web3 but web1 should not be affected.

If any one have easiest possible way to do this. Please share


texts: Change HTML Structure of Transaction E-Mail

texts:
I need to change the HTML structure of the E-Mail template for the "New Order E-Mail".

However I only see the tag {{layout handle="sales_email_order_items" order=$order}} in the Template. How/where can I change what that tag generates?


texts:
I created an e-mail template like this:

email_templates.xml

<?xml version="1.0"?>
  <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../Email/etc/email_templates.xsd">
  <template id="send_email_delivery_confirmation" label="Email Form" file="email_confirmation.html" type="text" module="Namespace_Module" area="frontend"/>
</config>

email_confirmation.html

Hello

    Hello
    Again

the problem is, when i open the email, the html tag not rendred at all, so it shows the html tag inside the email content:


texts: Magento 2 Bundle Product Add To Cart Like Simple Product

texts:
We have bundle products that are just groupings of simple products. I have disabled all options for the bundle products so that customers can't edit quantities etc. because I want them to act like simple products. For stock reasons, we need to use bundle products.

What I would like however is for the "ADD TO CART" Button to behave like a simple product and if it is clicked from say a "Category Page" It gets added directly to the cart. I.e. have the same functionality of simple products "add to cart" button from a "Category Page".

There are similar questions but so far I have not found a solution.

Current Code for the "Add To Cart Button" Is:

<?php $postParams = $block->getAddToCartPostParams($_product); ?>
<form data-role="tocart-form" action="<?php /* @escapeNotVerified */ echo $postParams['action']; ?>" method="post">
<input type="hidden" name="product" value="<?php /* @escapeNotVerified */ echo $postParams['data']['product']; ?>">
<input type="hidden" name="<?php /* @escapeNotVerified */ echo Action::PARAM_NAME_URL_ENCODED; ?>" value="<?php /* @escapeNotVerified */ echo $postParams['data'][Action::PARAM_NAME_URL_ENCODED]; ?>">
<?php echo $block->getBlockHtml('formkey')?>
<button type="submit"
title="<?php echo $block->escapeHtml(__('Add to Cart')); ?>"
class="action tocart primary">
<?php /* @escapeNotVerified */ echo __('Add to Cart') ?>
</button>
</form>


texts: Why is my url added to the enterprise_url_rewrite table but not core_url_rewrite?

texts:
Redirects in Magento have me utterly confused. Enterprise 1.13 has not helped the situation. My problem is this, I want to add a product link widget to the home page but newer products do not show up. I've traced the problem back to Mage_Catalog_Block_Widget_Link::getHref():

$urlRewriteResource = Mage::getResourceSingleton('core/url_rewrite');
$href = $urlRewriteResource->getRequestPathByIdPath($this->getData('id_path'), $store);

Now, the Mage_Core_Model_Url_Rewrite model uses the table core_url_rewrite. And my new products do not exist in that table! Weird, because they are Enabled, visible in Catalog, they have a url_key and I can navigate to the product page just fine. So they must exist in one of the other Enterprise tables. Which one?

core_url_rewrite -> Url Rewrites
enterprise_catalog_category_rewrite -> Relation between rewrites and categories
enterprise_catalog_product_rewrite -> Relation between rewrites and products
enterprise_url_rewrite -> URL Rewrite
enterprise_url_rewrite_redirect -> Permanent redirect
enterprise_url_rewrite_redirect_rewrite -> Relation between rewrites and redirects

Yep, it exists in the enterprise_url_rewrite table ...

+----------------+-----------------------+--------------------------------+-----------+------+-----------------------+-----+----------+----------+-------------+
| url_rewrite_id | request_path          | target_path                    | is_system | guid | identifier            | inc | value_id | store_id | entity_type |
+----------------+-----------------------+--------------------------------+-----------+------+-----------------------+-----+----------+----------+-------------+
|       31282261 | product-1-working     | catalog/product/view/id/256037 |         1 | xyz  | product-1-working     |   1 |  9236282 |        0 |           3 |
|       31294573 | product-2-not-working | catalog/product/view/id/268697 |         1 | xyz  | product-2-not-working |   1 |  9610723 |        0 |           3 |
+----------------+-----------------------+--------------------------------+-----------+------+-----------------------+-----+----------+----------+-------------+
2 rows in set (0.00 sec)

but not in the core_url_rewrite table ...

+----------------+----------+-------------+------------+----------------+-----------------------+--------------------------------+-----------+---------+-------------+
| url_rewrite_id | store_id | category_id | product_id | id_path        | request_path          | target_path                    | is_system | options | description |
+----------------+----------+-------------+------------+----------------+-----------------------+--------------------------------+-----------+---------+-------------+
|        3512685 |        1 |        NULL |     256037 | product/256037 | product-1-working.htm | catalog/product/view/id/256037 |         1 | NULL    | NULL        |
+----------------+----------+-------------+------------+----------------+-----------------------+--------------------------------+-----------+---------+-------------+
1 row in set (0.34 sec)

Next I tried reindexing the url indexes (and if someone could explain the difference between these I'd appreciate it)

$ php shell/indexer.php --reindex catalog_url_product,url_redirect
Product URL Rewrites index was rebuilt successfully
URL Redirects index was rebuilt successfully

Nope, still nothing. What do I have to do to get products in the core_url_rewrite table, other than by creating them manually myself?


texts: Magento 2 shipping method not present when I create order from admin panel?

texts:
I have created one shipping method which work properly on front end side but when I create order from admin panel it will not present there.
Can anyone guide me how can I display shipping method on admin panel?
Any help would be appreciated. Thanks in advance.


texts:
suddenly our checkout is stopped working, i can not able to click on any of 5 steps. i am seeing 5 steps as below image how to debug & fix the issue? no steps are clickable. even i reverted to default theme, still same problem.

if i click on any steps in checkout , nothing is happening.

i disabled all the modules , but still its not working.

2016-04-06T19:25:21+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid block type: ' in /home/company/public_html/3/em0113-full-package/app/Mage.php:595
Stack trace:
#0 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('', Array)
#2 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Model/Layout.php(472): Mage_Core_Model_Layout->createBlock('', '')
#3 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Model/Layout.php(239): Mage_Core_Model_Layout->addBlock('', '')
#4 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Model/Layout.php(205): Mage_Core_Model_Layout->_generateBlock(Object(Mage_Core_Model_Layout_Element), Object(Mage_Core_Model_Layout_Element))
#5 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Model/Layout.php(210): Mage_Core_Model_Layout->generateBlocks(Object(Mage_Core_Model_Layout_Element))
#6 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Controller/Varien/Action.php(344): Mage_Core_Model_Layout->generateBlocks()
#7 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Controller/Varien/Action.php(269): Mage_Core_Controller_Varien_Action->generateLayoutBlocks()
#8 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Checkout/controllers/OnepageController.php(211): Mage_Core_Controller_Varien_Action->loadLayout()
#9 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Checkout_OnepageController->indexAction()
#10 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#11 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#12 /home/company/public_html/3/em0113-full-package/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#13 /home/company/public_html/3/em0113-full-package/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#14 /home/company/public_html/3/em0113-full-package/index.php(87): Mage::run('', 'store')
#15 {main}


texts: How to Override my admin phtml and css file in my theme

texts:
How to Override my Admin PHTML, XML and LESS/CSS file in my theme.

Any one have Idea ?


texts: Magento 2 add Dropdown Quantity Box In Checkout Cart Page

texts:
I am trying to replace Drop-down instead of text box at Quantity at Checkout cart page.
How can i override
/Magento_Checkout/templates/cart/item/default.phtml
Thank you


texts: Newsletter queue limits to 40 rather than sending to all 70,000

texts:
My newsletters are not sent to all of my subscribers. I have 70,000 subscribers in my Magento database. After adding the template, then queuing the newsletter, schedule a date and time for it, it doesn't send out automatically at the scheduled date and time.

I have to login to admin and click "Send Newsletters", however when I do it only sends the newsletter to 40 each time. It's very long-winded to send to 70,000 subscribers like this!

I've looked at the settings and the Magento cron job is working fine, it just doesn't send to more than 40 subscribers.


texts: How to install paid theme in magento 2 online store

texts:
I want to know how to install paid theme in magento 2.

I want a tutorial which show me all actions step by step.


texts:
On magento backend admin , on invoice tab there are two options , Refund and Refund Offline , I believe that clicking on Refund button will do online Refund and the money will be refunded back to the users account .can any one please give me some brief idea what am I missing ? do I need to do some code to make it refund online or magento will do it automatically . magento version 2.2.3

I had placed an order using paypal sandbox and than triggered online refund from admin backend invoice tab . but its showing We refunded $15.00 offline.  I believe it should be online refund .

Thanks is advance.


texts:
When trying to boost code quality, I frequently encounter errors like "The use of function file_exists() is forbidden" when trying to use PHP file functions. This for instance happens with the Magento ECG coding standard and also with the Magicento plugin for PhpStorm. However, I'm kind of lost on what I should use instead. The ZF-1 documentation is not listing any wrapper like Zend_File so there must be something I'm overlooking ...

Anyone has an idea?


texts: Add Ajax Quantity Increment and Decrement Button on cart page in Magento 2

texts: I want to implement Ajax Quantity Increment and Decrement Button functionality on cart items on Cart page (not on Product detail and Minicart). I didn't find any article or any module to achieve this. Could anyone help me with it?


texts: Non default store_view's product attribute value is not visible on frontend (product list) if store_view 0 EAV value is missing

texts:
Scenario: A Magento 1.7 store which has NO default values at all for some product attributes (like short_description). There is no entry in catalog_product_entity_text for store_view==0. (Even NO entry with NULL)

(Background: The product attribute values are generated programmatically from some external source. Without any store_view 0 values. For whatever reason.)

Problem: The (well defined) product attribute value of the non-default store_view (e.g. store_view 2) is not visible in catalog product list.

Workaround: The store_view 2 value is displayed if we define a value for store_view 0 in catalog_product_entity_text. (E.g. NULL)

Following comment mentions a bug in "older" Magento versions:
Programmatically changed attribute is not visible on frontend (product list)

Also the indexer does not work: The attribute's value in catalog_product_flat_2 table is null.

Question: Is there any solution to allow empty or not defined store_view 0 product attribute values on "older" Magento versions?

(Of course "used_in_product_listing" is set to 1. And backend_type of the attribute short_description is "text".)


texts: Where can I connect with german magento users?

texts:
i am using the communitiy edition of magento but missing the community!!!
there are so many translation problems in the german magento backend so it wont help to ask english users.

thougt magento is such an individual customized shop (therefore i bought it) but ive got many problems and no one (german) to ask


texts: Adding extension attribute to category api response

texts:
The default response from magento 2 category api endpoint /rest/V1/categories/3 is

{
"id": 3,
"parent_id": 2,
"name": "Gear",
"is_active": true,
"position": 4,
"level": 2,
"children": "4,5,6",
"created_at": "2018-08-10 08:32:49",
"updated_at": "2018-08-24 08:02:27",
"path": "1/2/3",
"available_sort_by": [],
"include_in_menu": true,
"custom_attributes": [
    {
        "attribute_code": "description",
        "value": "
Gear Category Static Contents.
"
    },
    {
        "attribute_code": "display_mode",
        "value": "PAGE"
    },
    {
        "attribute_code": "landing_page",
        "value": "11"
    },
    {
        "attribute_code": "is_anchor",
        "value": "0"
    },
    {
        "attribute_code": "path",
        "value": "1/2/3"
    },
    {
        "attribute_code": "custom_layout_update",
        "value": "<referenceContainer name=\"catalog.leftnav\" remove=\"true\"/>"
    },
    {
        "attribute_code": "children_count",
        "value": "3"
    },
    {
        "attribute_code": "custom_use_parent_settings",
        "value": "0"
    },
    {
        "attribute_code": "custom_apply_to_products",
        "value": "0"
    },
    {
        "attribute_code": "url_key",
        "value": "gear"
    },
    {
        "attribute_code": "url_path",
        "value": "gear"
    }
]}

I would like to add a custom value to be passed in response, which is not derived from database, but generated based on certain calculation.

So my response should also contain

{
...
   {
    "attribute_code": "my_custom_flag",
    "value": "1"
   }
...
}

I tried the plugin approach and setting custom data in "afterGet" method, however it never shows up in response.

Appreciate any help on how to achieve this.

UPDATE: Basis Sairam's suggestion ...

Added di.xml as

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Catalog\Api\CategoryRepositoryInterface">
    <plugin name="my_category_plugin" type="My\Catalog\Plugin\CategoryPlugin"/>
</type>

Added extension_attributes.xml as

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Api/etc/extension_attributes.xsd">
<extension_attributes for="Magento\Catalog\Api\Data\CategoryInterface">
    <attribute code="my_custom_flag" type="string"/>
</extension_attributes>

And the plugin file

<?php
namespace My\Catalog\Plugin;

use Magento\Catalog\Api\Data\CategoryExtensionFactory;
use Magento\Catalog\Api\Data\CategoryExtensionInterface;
use Magento\Catalog\Api\Data\CategoryInterface;
use Magento\Catalog\Api\CategoryRepositoryInterface;

class CategoryPlugin
{

protected $extensionFactory;

/**
 * @param \Magento\Catalog\Api\Data\CategoryExtensionFactory
 * $extensionFactory
 */
public function __construct(\Magento\Catalog\Api\Data\CategoryExtensionFactory $extensionFactory)
{
    $this->extensionFactory = $extensionFactory;
}

/**
 * @param CategoryRepositoryInterface $subject
 * @param CaetgoryInterface $category
 *
 * @return CaetgoryInterface
 */
public function afterGet(\Magento\Catalog\Api\CategoryRepositoryInterface $subject, \Magento\Catalog\Api\Data\CategoryInterface $category)
{
    $extensionAttributes = $category->getExtensionAttributes();
    $extensionAttributes = $extensionAttributes ? $extensionAttributes : $this->extensionFactory->create();

    // set custom flag
    $extensionAttributes->setMyCustomFlag('1');

    // $extensionAttributes->setExtensionAttribute('my_custom_flag', '1');

    $category->setExtensionAttributes($extensionAttributes);

    return $category;
 }
}

However, the response from the API call never changes, it's still missing "my_custom_flag". It remains unaffected.


texts: How to get all attributes in source model

texts:
I am using a source model for fields of the configuration.
I want to get all product attributes (no matter the product or the attribute set) in this source model.


texts: How to increase execution time in magento?

texts: I want to update price for that I require minimum 15mins to execute the query. I want to increase in WHM.


texts: How do I properly setup multiple sites locally with apache vhost?

texts:
Locally I have setup two themes.

Theme Directories
app/design/frontend/VendorParent/default   //Inherits from Luma
app/design/frontend/VendorChild/default    //Inherits from VendorParent

On the admin side under Content -> Configuration, I have two websites setup.

Main Website      //Uses VendorParent theme
Another Website   //User VendorChild theme

Under my etc/hosts file I have added entries for both of these sites. I have also added these to the apache vhost file and pointed them both to the same location (magento folder)

127.0.0.1 mainsite.magento.dev
127.0.0.1 anothersite.magento.dev

I went under stores -> configuration -> general -> web. Here I turned off the 'Auto-redirect to Base URL' option for the default site. Then I went into the same place for the anothersite and changed the 'Base URL' and 'Base Link URL' to be anothersite.magento.dev (I also did this for secure urls here).

I can hit both urls properly, however when I go to anothersite.magento.dev, it is trying to load css files for the mainsite.magento.dev, and I am getting a bunch of font CORS errors in the console. here are the paths it is trying to load for the css.

mainsite.magento.com/pub/static/version1498747501/frontend/Main/default/en_US/mage
mainsite.magento.com/pub/static/version1498747501/frontend/Main/default/en_US/css
mainsite.magento.com/pub/static/version1498747501/frontend/Main/default/en_US/Main/css
mainsite.magento.com/pub/static/version1498747501/frontend/Main/default/en_US/css
mainsite.magento.com/pub/media
mainsite.magento.com/pub/static/version1498747501/frontend/Main/default/en_US/css

And here are the font CORS error paths.

Access to Font at 'http://mainsite.magento.dev/pub/static/version1498747501/frontend/Main/default/en_US/fonts/Blank-Theme-Icons/Blank-Theme-Icons.woff2' from origin 'http://anothersite.magento.dev' has been blocked by CORS policy
Access to Font at 'http://mainsite.magento.dev/pub/static/version1498747501/frontend/Main/default/en_US/fonts/Another/Another-Regular.woff' from origin 'http://anothersite.magento.dev' has been blocked by CORS policy:
Access to Font at 'http://mainsite.magento.dev/pub/static/version1498747501/frontend/Main/default/en_US/fonts/Blank-Theme-Icons/Blank-Theme-Icons.woff' from origin 'http://anothersite.magento.dev' has been blocked by CORS policy:
Access to Font at 'http://mainsite.magento.dev/pub/static/version1498747501/frontend/Main/default/en_US/fonts/Another/Another-Regular.ttf' from origin 'http://anothersite.magento.dev' has been blocked by CORS policy:

Actually now that I look at it, it is using the mainsite url for all assets being loaded on the anothersite url.


texts: Product Type is invalid or not supported even when uploading the CSV magento exported

texts:
I am trying to upload a csv file containing all of my products to my magento 1.9 installation. When I go to import and select the CSV file, and click check data I get this error message 'Product Type is invalid or not supported' and its saying its for all of my products.

Even if I export the current products on the website as a CSV and reupload them I get the same error.

Any idea why this is happening or how I can fix this?


texts:
I have installed extension successfully. The installed module is showing in "System->Configuration->Advanced->Disable Modules Output" in admin page. But it seems the module is not loaded.

The module should be shown in admin page and site. Anyway I have tested this module in localhost and it work fine. But not in share host(live host).

I have done all of this but no luck

  clear cache
  Log out and in
  disable magento compilation
  Do a chmod -R 777 on the root of your magento installation

Can someone suggest me how can I troubleshooting this situation?

Thanks

Here is the module's xml file

<?xml version="1.0"?>
<config>
    <modules>
        <Jayje_Rma>
            <active>true</active>
            <codePool>community</codePool>
        </Jayje_Rma>
    </modules>
</config>


texts: How to query Magento API for newest orders

texts:
I have built a php application which prints shipping labels for orders placed in a magento store - I use the REST API to query for order and customer data.

What is the correct technique to query the Magento store for the set of newest orders only?

So far I have simply been querying for order ids that are greater than the maximum order id that I already have but I think there must be a better way.


texts: SOAP API to build cart for frontend - should I be worried? session collision or cart loss?

texts:
My developer has written PHP code on his CMS that connects via SOAP on behalf of the user browsing the site, to manage the cart from their CMS.

I'm worried about the interaction of SOAP session (which owns the cart), frontend session (when the user finally gets to Magento), CMS session (which stores the SOAP session), the eventual "logged in" session if the user has an account

Do I need to be worried or is this actually a perfectly normal scenario?

I have a content site developed by an agency on their in house CMS which needs to integrate with a new Magento site

They are trying to build elements which show products within the cms, including an "add to cart" and a mini cart (ajax)

They are not Magento developers, just general PHP (cake) developers and at the moment the solution is a bit clunky and worries me:

product information copied over SOAP API to be available within the Cake CMS, nightly or on demand(that part does not worry me beyong mapping maintenance)
locally built Cake "cart" view which connects to Magento to add/edit cart over SOAP. Note that at this point shoppers are usually "guests"
when the customer clicks "checkout" they are taken to the Magento checkout pages to continue/finish in Magento, as guest or with log in.

it is the Cake->Magento cart over soap part that worries me. All the use cases for this are for an admin person to be creating an order, not for the user to be adding to cart as guest from another page.

SOAP is using its own API session (using a particular user), this session is stored for reuse in the Cake system (so the user's cart is stored in the cake CMS session via a SOAP session cookie which is passed to the cart and checkout links).

Because this is "php to Magento" I'm not sure the frontend session gets created/passed correctly (or different ones created) and I have no idea what happens when there are many visitors using this (all with same API user), and what happens when they log in to their Magento account too.

At first glance products are indeed added to cart properly but the more I look at it the more I worry there could be session collisions, session loss, etc

For one products added within Magento (say from a cart/checkout upsell) do not appear in the SOAP version of the cart, and I have also been unable to get them to make grouped products added as group products (see Magento SOAP API Add to cart, how to add a grouped product?)

I'm worried about the interaction of frontend session, cake session, SOAP session and the eventual user account login - but do I need to be worried or is this actually a perfectly normal scenario

PS: I hat assumed they would build it to use HTML and Javascript, with the add to cart created so that it submits direct to Magento (and later perhaps via Ajax) & the mini cart Javascript as well, but having spend the day exploring around these I am not seeing a clear path

PPS: What I really need is to be able to create clean "add to cart" buttons that work, including for grouped product, knowing the IDs  - and to pull and display the cart via Ajax. Not having much luck with either SOAP, PHP or Magento module so far.


texts: Replacing SKU with unit price in email confirmation of order?

texts:
G'day,
I've never worked with Magento before, so forgive my bull-in-a-china shop blundering.
I've been asked to replace the SKU with the items unit price in the order confirmation email, and after some googling, have found this howto :

Add Unit Price To Order Email Template

Which is pretty close, it leaves the Sku in and adds an extra column, that's just HTML tables and I think I get that.

BUT

Is this the right way to do it?  Reading through other howtos on how to muck about with order PDF's suggests that you should not go editing the base templates and code, but should instead use a local override in the app/code/local tree

Is that the case for this modification, is editing these files :

app/design/frontend/base/default/template/email/order/items.phtml

app/design/frontend/base/default/template/email/order/items/order/default.phtml

app/design/frontend/base/default/layout/sales.xml

The right way?  Or am I creating a maintenance disaster?

Magento 1.9


texts:
What is the use of Off loader header in CDN?

What is the difference between SSL_OFFLOADED & X-Forwarded-Proto.

When to use it? Is there any other type as well apart from above two?


texts: Magento 2 - Debug (Log) non-public functions

texts:
Intro
Magento 2 recommends mostly using Plugins, but it is rather restrictive - you can mostly just use plugins for public functions.
So, then we have preference for overriding classes and their methods (I think including protected methods).
So my question is regarding logging content for specifically private/protected functions:
Plugins should have been an easy way to just do something like this:
  use The\Class\To\Use\Plugin\On as ObservedType;
  namespace MyPlugin\Namespace;
  class MyLoggerPlugin{
      public function __construct($logger){
          $this->_logger = $logger;
      }
      protected function afterLogAProtectedFunction(ObservedType $type, $result){
          $this->_logger->info('log details' . $result);
      }
  }

So Magento2 recommends using plugins, but then makes it extremely hard to just do some debugging when trying to log information in protected methods.  So in the end you have to go against their recommended way and use preferences instead.
Question

What are my other options to log (debug) the content of these types of methods?  Should I really now have to override every single class where I want to debug protected functions when plugins would have been easier.  (I also do not see any events at the places which I might have used observers).

Reason
Specifically for anyone wondering why I need to see what is happening in protected functions:

Inside Magento\CatalogInventory\Model\ResourceModel\Indexer\Stock\DefaultStock class:
Github Direct Link here

I have debugged using xdebug inside VS Code and pinpointed this function: protected function _getStockStatusSelect.  It builds a HUGE SQL query there and if I try to view it in VS Code console the output gets trimmed to 1024 characters always.   The total length of the query usually is 3000+, so I can not see the contents of these because the official Magento 2 migration tool shows my products out of stock!. The official tool forces me now to debug SQL queries and output through the code, and now Magento 2 tools prevent me from doing this easily.

(My other question here is someone may assist regarding this: Regarding out stock products - Migration Tool)

SIDE NOTE: xdebug
These are the xdebug settings applied - specifically var_display_max_data = -1:
As per the description, quoted below my problem is exactly with the 'step debugging feature'.
  xdebug.var_display_max_children = 256
  xdebug.var_display_max_data = -1
  xdebug.var_display_max_depth = 15

Controls the maximum string length that is shown when variables are displayed with either xdebug_var_dump(), xdebug.show_local_vars, or through Function Traces.
To disable any limitation, use -1 as value.
This setting does not have any influence on the number of children that is sent to the client through the Step Debugging feature.


texts: PayPal Express Checkout saves address as default address saved in PayPal account

texts:
We are currently on Magento 1.9.0.1 and using Onestepcheckout 4.0.10

When a customer logins on OneStepCheckout page and uses the Paypal Express checkout option, the billing and shipping default to the one saved in their Paypal account. This only happens for customers logging in, however users transacting as guest end up placing the order with no hiccups.

I've read a lot of answers on SO saying we need to 0 the address_override in Paypal extension however that hasn't helped at all. I even tried this solution but it didn't really help.


texts: Use attribute label from another website

texts:
Is there an easy way of copying an attribute label from one website and using it in another on Magento.

I have just set up a number of new websites in a multistore environment to allow for international sales and would like the attribute labels from the original store to be copied across into the new stores.

Thanks,

Hugh


texts: How to migrate data to from magento 1.9.1 to 2.0.4?

texts:
I have install magento 2.0.4 and now I want to migrate all database table, theme, content everything from old version 1.9.1 to this new one 2.0.4. I have gone through many articles saying that the database structure and themes are all different in 2.0.4 .Can anyone guide with steps on how can I successfully transfer all data to new version?
Thank you.


texts: How to setup seller subdomain page for vendors?

texts:
I want to setup a different page for sellers using the subdomain "seller.websitename.com" where they can have their own dashboard and every options required to them.
Please help me setting this?


texts: manage to access (work on) a new Magento install using the same domain as a live production store on a completely diffrent hosting acc (different IP)

texts:
I have 2 hosting accounts - an old VPS account and a new CLOUD account. I have an old version of Magento (1,3,1) running on the old VPS hosting account (this needs to be the active one because I have all my products there and it is the current production store). I want to upgrade by just doing a fresh install of the Magento 1,9,1 version so I created a new MYDOMAIN.com account on the cloud server and then I installed the new Magento shopping cart there (1,9,1). I planned to access that by using the IP address (numerical IP address and then the account user name) but now - when I click on the IP address in the list of hosting accounts in the WHM (basically just try to access the new shopping cart by it's actuall IP address and a user name on the server) - it automatically loads the actual MYDOMAIN.com website (on the old server). I mean - the old website suppose to be the one active (loading from the VPS hosting account) but at the same time - I need to work on the new version of the shopping cart before it's all ready to go live (change design, add hundreds of products etc.)

How can I work with this new version of the Magento shopping cart without it reverting to the (old) production site?

Thanks,

Allysin

PS: Is this something in the htaccess file or something like that?

PS2: The hosting company replied this but I don't really understand it...

The easiest way to work on your new Magento site is to create a subdomain within your account MYDOMAIN.com .
You will have to create new folder within public_html or wherever you like and call it, for example test.

Then, within your cPanel account merge that subdomain with created folder and you can start testing.
Of course, you will have to copy content to newly created folder.

I cannot have a special directory where Magento resides I think because of the SEO links would not be the same as in the old store...

Thanks again for any suggestions. ;-)


texts: Bluefoot Pagebuilder in Magento 2.3.x CE?

texts:
I searched a bit but did not find an official statement for that. So, is the Bluefoot Pagebuilder included in Magento 2.3.x Community Edition or will it definitely be included in future releases of the CE?

Thanks!


texts: Magento 2: How to create observer for adding data to table after order

texts: Magento2: How to create observer for adding data to table after order.


texts: Magento 2 How to change event of postcode in customer checkout address form?

texts:
I am developing custom shipping module for magento 2.2.

When you're filling out the Shipping Address form in Magento 2, periodically Magento will make an ajax request for the URL

http://magento.example.com/rest/default/V1/guest-carts/[hash]/estimate-shipping-methods

I changed postcode text field to autocomplete text field. Now when i type something in text field it make ajax request to above mention url. But after two or three character type, it shows auto suggest fields(which i added in autocomplte) and if I select one from that it doesn't generate any ajax call.

I added autocomplete code in my custom js as per below

setTimeout(function(){
        jQuery("input[name='postcode']").autoSuggest(data.items,
        {
            selectedItemProp: "name",
            searchObjProps: "name",
            selectionLimit: 1,
            minChars: 3,
            selectionAdded: function(elem)
            {
                result = elem.text();
                getresultval(result);
            }
        }
        );
    }, 6000);

So, my problem is when I write on text box it works but when I select something from auto suggestion it doesn't work. That means issue is with binding event of postcode text field.

So how to resolve this?


texts: When I change store view that badly affect to front view

texts:
When I am  changing store view, it affects the whole front end design of my site

How to fix it.


texts: Magento 2 - cant modify quote before placing order

texts:
I try to delete all items with a custom product type from the quote before the order is placed. So I created an observer for the event sales_order_place_before. In this observer I am collection all items with my custom product type ral_surcharge and try to delete them from the quote. But after the order is placed, the items are still there.
What am I doing wrong?
MODULE/etc/webapi_rest/events.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_place_before">
        <observer instance="Company\RalSurcharge\Observer\Webapi\Sales\OrderPlaceBefore"
                  name="company_ralsurcharge_observer_webapi_sales_orderplacebefore_sales_order_place_before"/>
    </event>
</config>

MODULE/etc/webapi_soap/events.xml
<?xml version="1.0" ?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
    <event name="sales_order_place_before">
        <observer instance="Company\RalSurcharge\Observer\Webapi\Sales\OrderPlaceBefore"
                  name="company_ralsurcharge_observer_webapi_sales_orderplacebefore_sales_order_place_before"/>
    </event>
</config>

MODULE/Observer/Webapi/Sales/OrderPlaceBefore.php
<?php

namespace Company\RalSurcharge\Observer\Webapi\Sales;

use \Magento\Quote\Model\QuoteFactory;
use \Magento\Framework\Event\ObserverInterface;
use \Magento\Framework\Event\Observer;
use \Company\RalSurcharge\Helper\RalSurcharge as RalHelper;

class OrderPlaceBefore implements ObserverInterface
{
    /**
     * @var \Magento\Quote\Model\QuoteFactory
     */
    private $quoteFactory;

    /**
     * @var \Company\RalSurcharge\Helper\RalSurcharge
     */
    private $ralHelper;

    public function __construct(
        RalHelper $ralHelper,
        QuoteFactory $quoteFactory
    ) {
        $this->ralHelper = $ralHelper;
        $this->quoteFactory = $quoteFactory;
    }

    public function execute(Observer $observer)
    {
        $quoteId = $observer->getOrder()
                            ->getQuoteId();
        $quoteModel = $this->quoteFactory->create();
        $quote = $quoteModel->loadByIdWithoutStore($quoteId);
        $this->ralHelper->main($quote);
    }

}

MODULE/Helper/RalSurcharge.php
<?php

namespace Company\RalSurcharge\Helper;

class RalSurcharge
{
    private $allItems;
    private $quote;

    private $logger;

    /**
     * @param \Magento\Quote\Model\Quote $quote
     */
    public function main($quote)
    {
        $writer = new \Zend\Log\Writer\Stream(BP . '/var/log/zend_debug.log');
        $this->logger = new \Zend\Log\Logger();
        $this->logger->addWriter($writer);

        $this->logger->info("Hello from main");

        $this->quote = $quote;
        $allItems = $this->quote->getAllItems();
        $collection = $this->getItemsWithProductType("ral_surcharge");
        $this->deleteItemsFromQuote($collection)
    }

    private function deleteItemsFromQuote($items)
    {
        if (empty($items)) { return false; }

        foreach($items as $item) {
            $this->logger->info("delete item '". $item->getName() . "' from quote.");
            $this->quote->deleteItem($item);
        }
        $this->quote->save();
    }

    private function getItemsWithProductType($type)
    {
        if (empty($this->allItems)) { return false; }

        $collection = [];
        foreach($this->allItems as $item) {
            if ($item->getProductType() === $type) {
                $collection[] = $item;
            }
        }
        return $collection;
    }

    ...
}


texts: How do I disable file image renaming when creating products programatically?

texts:
I am creating products and adding images to them using

$configurable->addImageToMediaGallery($filePath, array('image', 'small_image', 'thumbnail'), false);

This works fine. However I am getting files save in the media folder with names like:

/media/catalog/product/w/w/wwwhatever_2_4_1_2_1_3_1.png

After a few test runs the proliferation of these media files is jolly alarming. I am also attaching the files to the simple products using the same technique as for the configurable.

I have tried setting $uploader->setAllowRenameFiles(false); in various places, which I thought might fix the problem. But that didn't work.

I am looking for a solution that ideally enables the file renaming to work as normal during normal admin operation, e.g. for CMS files etc., but breaks the rule just for my product creation module.


texts: Layout file is not loading for custom page magento2

texts:
I have created custom pages a lot of times, but never face such issue. I have tried 'echo' in controller action, it is working. But all this time the layout file is not loading for that page.

Here are my code files.

Controller/Customer/Test.php

class Test extends \Magento\Framework\App\Action\Action
{
   protected $_pageFactory;

   public function __construct(
    \Magento\Framework\App\Action\Context $context,
    \Magento\Framework\View\Result\PageFactory $pageFactory)
   {
       $this->_pageFactory = $pageFactory;
       return parent::__construct($context);
   }

  public function execute()
   {

       $page =  $this->_pageFactory->create();
       return $page;
   }
}

etc/frontend/routes.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
    <router id="standard">
        <route id="orderbysku" frontName="orderbysku">
            <module name="Vendor_Module" />
        </route>
    </router>
</config>

view/frontend/layout/orderbysku_customer_test.xml

<?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>
        <referenceContainer name="content">
            <block class="Magento\Framework\View\Element\Template" name="helloworld_index_index" template="Vendor_Module::index.phtml" />
        </referenceContainer>
    </body>
</page>

Any kind of help is appreciated, i'm really having a hard time to figure it out.


texts:
Add to cart button in selected products in my code
function () {
            var self = this;

            $('body').delegate('#product_grid_table tbody tr', 'click', function () {
                var el        = $(this);
                var prodId    = el.find('.col-id').text().trim();
                var prodName  = el.find('.col-name').text().trim();
                var prodSku   = el.find('.col-sku').text().trim();
                var prodPrice = el.find('.col-price').text().trim();
                var prodQty   = el.find('.col-barcode_qty').text().trim();

                el.find('input').attr('checked', 'checked');

                $("#deal_product_id").val(prodId);
                $("#deal_product_name").val(prodName);
                $("#deal_product_sku").val(prodSku);
                $("#deal_original_price").text(prodPrice);
                $("#deal_product_qty").text(prodQty);
                $(".modal-title").text(prodName);

                self.initDiscount();
            });
        },

What is the code I need to have an add to cart button?
Thank
Malka


texts:
Here is my installation, 1 website (1 domain) with 2 Each store and store view. Note that I am not coding or programmer, which explains my question:

I would like to replace the "switch store" by a navigation bar to select the desired store, as these 2 website:

http://www.diapers.com

http://www.gap.com/

Can you tell me what I should do and where to start?

Thank you in advance


texts:
We want to extend the sale that we had for June to the end of July, when i go to Catalogue - Product - Edit the product - advanced pricing - change the date. When we hit done and go back everything looks good, but when we click save the date go back to the old value.
Every time we try to change the date we get this error in the code:
[2020-07-02 13:30:26] main.INFO: SELECT `e`.*, IF(at_special_price.value_id > 0, at_special_price.value, at_special_price_default.value) AS `special_price`, `at_special_from_date`.`value` AS `special_from_date`, `at_special_to_date`.`value` AS `special_to_date`, `mc`.* FROM `catalog_product_entity` AS `e`

LEFT JOIN catalog_product_entity_decimal AS at_special_price_default ON (at_special_price_default.entity_id = e.entity_id) AND (at_special_price_default.attribute_id = '78') AND at_special_price_default.store_id = 0
LEFT JOIN catalog_product_entity_decimal AS at_special_price ON (at_special_price.entity_id = e.entity_id) AND (at_special_price.attribute_id = '78') AND (at_special_price.store_id = 1)
LEFT JOIN catalog_product_entity_datetime AS at_special_from_date ON (at_special_from_date.entity_id = e.entity_id) AND (at_special_from_date.attribute_id = '79') AND (at_special_from_date.store_id = 0)
LEFT JOIN catalog_product_entity_datetime AS at_special_to_date ON (at_special_to_date.entity_id = e.entity_id) AND (at_special_to_date.attribute_id = '80') AND (at_special_to_date.store_id = 0)
LEFT JOIN mailchimp_sync_ecommerce AS mc ON mc.type = 'PRO' AND mc.related_id = e.entity_id AND mc.mailchimp_sync_modified = 0  AND  mc.mailchimp_store_id = 'xxxxxxxxxxxxxxxxxxxxxxxxxx' and mc.mailchimp_sync_delta < (IF(at_special_from_date.value_id > 0, at_special_from_date.value, at_special_from_date_default.value)) WHERE (IF(at_special_price.value_id > 0, at_special_price.value, at_special_price_default.value) > 0) AND (((((at_special_from_date.value <= '2020-07-02 23:59:59') OR (at_special_from_date.value IS null))))) AND (((((at_special_to_date.value >= '2020-07-02 00:00:00') OR (at_special_to_date.value IS null))))) AND (mc.mailchimp_sync_delta is not null) [] []
[2020-07-02 13:30:26] main.CRITICAL: API Key Invalid for Api Call: https://us18.api.mailchimp.com/3.0/ecommerce/stores - Your API key may be invalid, or you've attempted to access the wrong datacenter. [] []
I could see there was 2 API keys on Mailchimp but when try to change the API, the same thing happens the old value goes back and do not save the value.
Anyone knows why this is happening? Someone mentioned a database reset, but not sure how to do that.
Any help is appreciated


texts:
Recently I have created a site but I have some issues related to redirections for this http://www.klikgenie.com/women-44/designer-handbags.html

But when I click on the products of this category it is redirecting me
http://www.klikgenie.com/catalog/product/view/id/12030/category/172/

And also urls of product page from this category was not created properly.
Please let me know what I need to do?


texts:
i followed this tutorial

http://www.excellencemagentoblog.com/magento-onestep-checkout-remove-payment-method-step

to try to skip the payment method step in the one page checkout. But after searching a lot what the error could be i can not get past the shipping method step and go to the review page.

Can somebody please have a look or tell me how to debug this?
this is the installation http://www.agfbelgie.be/newmagento/index.php/checkout/onepage/
i made a user test@test.com with password test123.

Help is really appreciated.


texts: How can I customize the widget on the homepage on Magento2 Luma theme?

texts:
I have been trying to locate the code for the widget to no avail. I'll like some help with customizing the widget.

Here is the screenshot of the widget:


texts: How to compose URL for AJAX in Adminhtml Magento 1.9

texts:
I'm inside the Admin area, I'm adding a check inside the products, inside my File phtml write:

<?php $ajaxUrl = Mage::helper('adminhtml')->getUrl('adminhtml/MyCompany_MyModule_AjaxController/check'); ?>

This is real path

\http\app\code\local\MyCompany\MyModule\controllers\ajaxController.php

This is the Function inside file phtml

function check(element) {
    new Ajax.Request('<?php echo $ajaxUrl ; ?>', {
    method:     'get',
    onSuccess: function(transport) {
        alert('Sent notification.');
    },
    onFailure: function(transport) {
        alert("Couldn't send a notification. ");
        console.log(transport);
    }
});}

This is inside my controller:

    public function checkAction()
{
    $value= 'example';
    Mage::app()->getResponse()->setBody($value);
}

and this is my config.xml

    <admin>
    <routers>
        <adminhtml>
            <args>
                <modules>
                    <MyCompany_MyModule before="Mage_Adminhtml">MyCompany_MyModule</MyCompany_MyModule>
                    <MyCompany_MyModule after="Mage_Adminhtml">MyCompany_MyModule_Adminhtml</MyCompany_MyModule>
                </modules>
            </args>
        </adminhtml>
    </routers>
</admin>

Premise, the ajax call works but I always get 404 error back
I'm pretty sure the paths are wrong,
but I can not understand how to set them up, can you help me?
thank you


texts: how to remove decimal value from product price Magento 2?

texts:
The price-utils.js solution did not work for me.

I have changed from  const DEFAULT_PRECISION = 2; To const DEFAULT_PRECISION = 0; in  /vendor/magento/framework/Pricing/PriceCurrencyInterface.php

but, it is working only on the product listing page. I want to remove precision from the entire site.


texts: B2B extension for allowing users create other users

texts:
We have a site where a user needs the ability to create another user and have that user account linked to their account. Think of a store owner that has employees and the store owner needs to create employee accounts. Orders that are placed by employees need to be seen by the owner, possible approval and what not.

It wouldn't make sense in this case to make them admins, there is already functionality to make it so you have to be registered to view the site.

I figured that has to be an extension for this, as this is about the 3rd time a request like this has came to us. Before actually building it out I figured I would look for something but I can't find anything.


texts: How can i configure shipping method - i need to cost calculated by weight related to zip code

texts:
How can i configure shipping method - cost calculated  weight by zip code. how can i provide weight range and price for multiple zip code.

eg : Different zipcodes and weight range

Is this right or wrong or may i do any changes... ??

Note : am using Webshopapps Matrix Rates extensions.


texts: Class 'Mage_Testswatchplus_Helper_Data' not found in root../app/Mage.php on line 547

texts:
After I removed 1 extension : I encountered this problem . ( I removed the code , database )
Class Mage_mageswatchplus_Helper_Data not found in root../app/Mage.php on line 547
Line code in 547:  self::register($registryKey, new $helperClass);
I have tried many ways , Config .- > tool > Compilation is disabled
Plseas,tell me, how fix it!


texts: Sales Order grid new column order comment show recent comment only

texts:
In magento CE 1.7.0.2

Add new column to sales order grid which have a most recent order comment.

Following code used to add column

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

    // Add order comment to grid
    $this->addColumn('ordercomment', array(
        'header'       => Mage::helper('ordercomment')->__('Order Comment'),
        'index'        => 'ordercomment',
        'filter_index' => 'ordercomment_table.comment',
    ));

    // Fix integrity constraint violation in SELECT
    foreach ($this->_ambiguousColumns as $index) {
        if (isset($this->_columns[$index])) {
            $this->_columns[$index]->setFilterIndex('main_table.' . $index);
        }
    }

    return $this;
}

But comment shown in grid is first comment on order.

How most recent comment will show in this column?


texts: Add image to product programatically not using addImageToMediaGallery

texts:
Method addImageToMediaGallery() seems to me buggy, when using productRepository to save product, what encourage us to use deprecate method save() directly from product model (what causes other bugs), when trying to add product programatically. What is the correct way to add image, what classes should I use in order to perform it using repository. I have added question here in comments (accepted answer seems to provide some general clues), but I think this subject deserves separte question, as stack and internet tutorials are full of deprecate code. Some real example of code would be extremely useful.

EDIT

I have found an answer - it can be done using other object - example here


texts:
I have an application where the user logs in, and I have a web service where I can send the data.

How can I get the user logged in automatically to the e-commerce with the data received?


texts:
I am developing a solution with an external payment gateway. I create the order and then send the user to the gateway. When coming back from the gateway with a success i resend the order confirmation in my custom callback controller.

But the order confirmation email is sent once already when the order is first created. How do i intervene and stop this? I does not seem to find the correct event to do this in using an observer.


texts: Create a Product Subcategory same as Category

texts:
I'm using magento 2, and I'm building my main navigation by creating the product categories.

I need to have CLOTHING as category and DRESSES as subcategory for CLOTHING , but I also need to have DRESSES next to CLOTHING , as it would be a category , even if is not.. and I want to have same target for both of them.

My question is , do I have to create DRESSES twice ? once as subcategory and once as category , or there is any way to just print the link with his eventually other subcategories ?


texts:
Before you mark this thread as duplicate please read the following:

I'm having a hard time getting to Connect manager
I tried all possible solutions from similar threads like:

Changing folder and file permissions for downloader directory(755 for dir,644 for file)
flushing cache(although i didn't delete it, just did the "Clear magento cache
from admin panel")
i did permission reset for directories so all permissions are having default values.
tried to access manager directly(mysite.com/downloader/index.php)

I'm getting desperate... I hope there is someone to help me solve this problem.

Magento ver is 1.9.1.0


texts: How to override customer login.phtml and customer_account_login.xml file in custom module Magento 2?

texts:
I need to customize a customer login form. I need to add social media button in that page as well as register page.

So please give me a solution with customer_account_login.xml and Login.php update and How?

Tried:

<referenceContainer name="content">
    <referenceBlock name="customer_form_login">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Lucent_SocialLogin::form/login.phtml</argument>
        </action>
    </referenceBlock>
</referenceContainer>

i did in custom module Lucent\SocialLogin\view\frontend\layout\customer_account_login.xml but not workin


texts: inserting custom block next to each item in checkout cart

texts:
I would like to add a custom block next to each item displayed in the shopping cart, which has access to the properties of the specific product it has access to.

Since, this is a part of a plugin, I need to do so without hardcoding anything into core files, i.e. only through the use of layout.xml/event handlers. Any other way which does not involve modifying Magento files.

For example: adding a button which displays itself next to each item in the shopping cart, and performs an action on the SKU of the particular product it is displayed next to.

I will post a screenshot of what I mean shortly.

Just to be clear I do not want to override the existing block, I want to "add" to it


texts: About Magento2 backend form button "Save", "SaveAndContinue"

texts:
To create a backend form via ui_component, I define following in the config file to display buttons save and saveAndContinue Button

<item name="buttons" xsi:type="array">
    <item name="save" xsi:type="string">namespace\module\Block\Adminhtml\Edit\SaveButton</item>
    <item name="save_and_continue" xsi:type="string">namespace\module\Block\Adminhtml\Edit\SaveAndContinueButton</item>
</item>

Respectively, two files SaveButton.php and SaveAndContinueButton.php are created and both implement ButtonProviderInterface

As I know, button is mainly rendered from a getButtonData function. See SaveAndContinueButton.php

public function getButtonData()
{
    $TodoItemId = $this->getTodoItemId();
    $data = [];
    if ($TodoItemId) {
        $data = [
            'label' => __('Save and Continue Edit'),
            'class' => 'save',
            'data_attribute' => [
                'mage-init' => [
                    'button' => ['event' => 'saveAndContinueEdit'],
                ],
            ],
            'sort_order' => 80,
        ];
    }
    return $data;
}

The data_attribute is where that I don't understand. How does it know which file to handle save request?

If we check the SaveButton.php, We saw

$data = [
    'label' => __('Save TodoItem'),
    'class' => 'save primary',
    'data_attribute' => [
        'mage-init' => ['button' => ['event' => 'save']],
        'form-role' => 'save',
    ],
    'sort_order' => 90,
];

I know in the ui_component config file, there is

<item name="submit_url" xsi:type="url" path="path/to/save"/>

Both action successfully execute same Save.php file and it makes sense. What confuse me much is data_attribute and how does SaveAndContinueButton  pass parameter "back" so that it knows to stay at the same page instead of go to grid (normally grid is entry point of a form, aka edit page).

If we take another look at the deleteButton, it's another landscape

$data = [
    'label' => __('Delete'),
    'class' => 'delete',
    'on_click' => 'deleteConfirm(\'' . __(
        'Are you sure you want to do this?'
    ) . '\', \'' . $this->getDeleteUrl() . '\')',

    'sort_order' => 20,
];

It directly executes the onClick JavaScript event. Any idea/suggestion will be appreciated. thanks

One more question: what's the different of data_attribute and on_click? or advantage one over another one?


texts: no commands defined in the "setup" namespace. in Magento2

texts:
I have problem when I run this command:
When running this commond after making custom modules.

php bin/magento setup:upgrade

I also try running the command.

sudo chmod -R 777 var pub
sudo php bin/magento setup:upgrade

But still gives same error.


texts: Get md5 from salted md5 and salt in Magento1 and CS-cart

texts:
I am migrating customers from CS-Cart to Magento 1. But I am not getting how can I migrate customers password.

As Magento1 uses md5 and also cs-cart uses md5, but cs cart uses it with salt.

I know salted hash and also salt, but not getting how to get md5 string with salt and salted hash.

update customer_entity_varchar set value = md5('testtest') where entity_id=$customer_entity_id and attribute_id in (select attribute_id from eav_attribute where attribute_code = 'password_hash' and entity_type_id = 1);

using this we can import plain md5 in magento1. But I am not getting how to get md5 without salt from salt and md5 salted.

Please help


texts: Fatal Error Mage.php on line 329 - Magento on Windows 10

texts:
I have this code in Magento (installed on Windows 10):

<?php
include_once('C:/xampp/htdocs/magento/app/Mage.php');
$rootMagento = Mage::getBaseDir();
$files = scandir($rootMagento);
$count = sizeof($files);
for ($i =0; $i< $count; $i++) {
    if ($files[$i]=='productData.txt'){
        $fileAperto = fopen($files[$i], "r");
        while (!feof($fileAperto)){
            $nome = trim(substr($buffer,0,20));
            if ($nome =='') {
                Mage::log ('manca il nome');
            }

        }
    }
}
?>

and, when I run it, I have this error:

  Fatal error: Call to a member function getOptions() on a non-object in C:\xampp\htdocs\magento\app\Mage.php on line 329

I try also to print some variable's value but system.log file is always empty.


texts: I am altering shipping items knockout template where I came across ko-checked binding. What is the difference between ko-checked and checked binding?

texts: Ko-checked is a binding used in magento checkout in vendor/magento/module-checkout/view/frontend/web/template/shipping-address/shipping-method-item.html file. If anyone knows more about this binding? How it is different from checked binding?


texts: Error with Catalog Url Rewrites based on category

texts:
I actually have exactly the same problem as posted here An error occurred while saving the URL rewrite after upgrading from CE 1.9.0.0. to 1.9.3.3. I get the error:

An error occurred while saving the URL rewrite

the log file shows me this beautiful piece of work

exception 'PDOException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'category/subcategory1/subcategory2.html-3' for key 'UNQ_CORE_URL_REWRITE_REQUEST_PATH_STORE_ID'' in C:\directory

As in the link provided the problem does not lie in a product but rather in the categories. I have tried truncating the index, but this results in a php deadlock which I'm unable to resolve. As the above linked question does not have an adequate answer could someone please enlighten me how to fix this without truncating the core_url_rewrites table. Thank you so much in advance.


texts:
I'm having a bit of issues with the REST api, I can't find any documentation that shows me all the fields that I can use and the official documentation at http://www.magentocommerce.com/api/rest/introduction.html seems incomplete...

One issue is that I can't set the website_id and category_id when I create a new product.

Another issue, I can upload a picture but I don't know which fields I need to set to make it base image / small image / thumbnail...

Any help would be appreciated!


texts: .htaccess Magento stopping access to other sites on server

texts:
I have a mutliple magento site on a Shared Server. I appeciate that this is not ideal at all to share site on a shared server as the resources are limited, however its working ok.

I have to have the .htaccess file  in the route of my server, however my sites in in sub folders

Site1.com looks at
TheServerRoute/Website/Website1/

Site2.com looks at
TheServerRoute/Website/Website2/

This works perfectly, however if I want to throw a standard site on the same server, HTML or PHP (not magento) i get issues.

Basically i put the site at
TheServerRoute/Website/Website3/

if i navigate to Site3.com i get nothing, 404 server error, if I navigate to Site3.com/index.html it will show the html page I made, equally if i go to Site3.com/index.php it will show the php page I made. I think this is related to my .htaccess folder rewriting things or something like that, so index files do not automatically show when navigating to a folder. Should the .htaccess that I have in my route, even be sat in my route? or should i have a file sat in the individual site routes (i.e. Website1 and Website2 folders) etc?

I am new to Linux and the use of .htacccess and somewhat lost...

I have tried
 - deleting the .htaccess files (clearly this messes up  my magento access)
 - deleting the .htaccess and placing a copy inside the relevant magento folders

Now I am a stuck for methods. Perhaps my understanding on a .htaccess file is wrong...

Hopefully you guys can help, and we can provide a resource for people to look at, as googling this came up with nothing...

Look forward to some thought, questions, comments and suggestions :)

UPDATE
I have narrowed it down to two areas in my .htaccess file. Either

## default index file
DirectoryIndex index.php
<IfModule mod_php5.c>

which i don't think is an issue, but

## rewrite everything else to index.php
RewriteRule .* index.php [L]
</IfModule>

which i think is where the problem lies.

Is it possible to do a RewriteRule to html and then if this doesn't exist then try php?

Or am i just better off making a standard index.php file in each directory which redirects to the HTML version?


texts:
When I click "Update cart" or "Empty cart" (text may be different, I'm using Magento AT in 1.9.0.1) nothing happens. The page refreshes but the content of the cart is not changed.I have had it running on another webshop for some time and just found out about this one not working.
I have of course looked up the error and it seemed to be a problem on 1.8 that could be easily fixed (see link). I have tried if it was possible to fix it like this, but all the fixes mentioned on the page are already in the code of my default template, so nothing to change there.
I have tried to find a potential misconfiguration in the settings, but was not able to find one.

Edit:
Just to make some things clear that I may have messed up, since english is not my first language: I am talking about the cart that you are automatically redirected to, when you add an item to the cart and also the page where you can check out.
I can add items initially, but clicking the button "Empty cart" or "Update cart" does nothing but reloading the page.
The parent theme of my theme is 'default/modern'.


texts:
It seems there is no order state event by default, so how do you usually go about observing order state change?
There are two possibilities I see:
a) Overwrite the sales/order model to create your custom event for a state change
b) Observe the order save event and look at the state in there

Is one of these the way to go or is there a better option?

Edit:
Thanks for your answers so far.
The situation is a bit more complicated. I want to add information to the order depending on the current state. Now here is the problem:
In the save_before event I still have the old state and do not now the new state, because in the sales/order model the _beforeSave() method is as follows:

parent::_beforeSave();
$this->_checkState();
//...

So the event is processed in parent::_beforeSave(); BUT the order state is actually changed afterwards in $this->_checkState(); (this is the automatic change, e.g. if you create an invoice, the state is moved to processing if no shipment is there, yet)

I cannot use the save_after event either, since I want to save sth. at the order and it would probably break everything to call a save in the save_after event.

Any ideas? My only idea now is to replicate the $this->_checkState(); behavior in my save_before observer to find out what the state will finally be...


texts: I used chown from SSh and now i can't access ftp anymore

texts: I run the command chown -R root:1003 . in SSH and now when I try to connect to FTP it says Access Denied, what should I do to fix this problem ? The 1003 it's the group code for my httpacces folder. The httpacces is the location where I installed my Magento2 and I tried to make user root the owner of all folders and sub folders, the problem is that I can't access FTP even with root.


texts: Magento 2 REST API: add item to cart with additional info_buyRequest attributes

texts:
Adding a product to a customer's cart via the REST API is easy enough. However, in our case we also want to add additional info_buyRequest options. But the documentation isn't really clear on how to add more buy request attributes for such a request.

We tried with

{
    "cartItem": {
        "sku": "243612",
        "qty": 1.0,
        "quote_id": "23627",
        "product_option": {
            "info_buyRequest": {
                "foo": "foobar"
            }
        }
    }
}

but had no luck with that. Is there any way to do that?

Magento Version: 2.3.2


texts: How i can upgrade magento version without ssh from 1.8.1

texts:
when i am trying with magento connect its showing following

Already installed: community/Lib_Js_Ext 1.7.0.0, skipping
Already installed: community/Lib_LinLibertineFont 2.8.14.1, skipping
Already installed: community/Lib_Js_Calendar 1.51.1.1,
Already installed: community/Lib_Phpseclib 1.5.0.0, skipping
Already installed: community/Lib_Credis 1.8.0.0, skipping
Already installed: community/Lib_Pelago 1.9.1.0, skipping


texts:
I want to setup Magento on Magento-Cloud. I have tried to set it up. But when I see at the directory, I can see all the Magento directory and the files listed there. But during setup of cloud I didn't get any information to install the database or create any database. So currently I am getting error when I tried to access front URL and the error is,

  " report.CRITICAL: MySQL adapter: Missing required configuration
  option 'host' "

Also when I check the env.php file, just kind of below details are present, not even db connection codes.

<?php
return array (
  'MAGE_MODE' => 'production',
  'cache_types' =>
  array (
    'compiled_config' => 1,
  ),
  'cron' =>
  array (
    'enabled' => 0,
  ),
);

Anybody knows what I forgot to set it up Magento on Magento-Cloud?


texts: Gateway Timeout 504 after Clearing Cache

texts:
My new Magento 2 installation is stuck in a 504 Gateway Timeout state.

I removed the Cache folders via FTP
The Cache files have been recreated up to the letter F
There is 23Gb space available

Any pointers would be gratefully received.

Kevin


texts:
Im trying use the command bin/magento setup:upgrade in magento 2.1.2 on macOS but the terminal show this error:

Parse error: parse error in /Applications/MAMP/htdocs/Magento/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93

How can solved this?


texts: Mysql - How to Restore database from '/var/lib/mysql/' ubuntu

texts:
I want to restore my database from /var/lib/mysql/<database>.

I have tried with this process,

1) First, I stop mysql service.

2) After that, I copy my database from /var/lib/mysql/<database> old server to new server /var/lib/mysql/<database>.

3) Change all permission of that database

4) Then, I have restarted MySQL service.

but the result is I have seen all tables but when I click on the tables then there are no data in the table. In the database, I have around 374 tables, but in phpmyadmin I see only 13 tables.

And also table type change innoDb to memory.


texts:
I am using Magento 1.13 Enterprise.
I have two custom modules which rewrite the core class app/code/core/Mage/Catalog/Block/Product/List.php :

app
---code
------local
---------Mynamespace
------------BigFinder
------------Robots

In app/code/local/Mynamespace/BigFinder/etc/config.xml I have :

<config>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <category_view>Mynamespace_BigFinder_Block_Catalog_Category_View</category_view>
                </rewrite>
            </catalog>
        </blocks>
    </global> </config>

And in app/code/local/Mynamespace/Robots/etc/config.xml I have :

<config>
    <global>
        <blocks>
            <catalog>
                <rewrite>
                    <category_view>Mynamespace_Robots_Block_Catalog_Category_View</category_view>
                </rewrite>
            </catalog>
        </blocks>
    </global>
</config>

I would like to keep my two modules and rewrite the app/code/core/Mage/Catalog/Block/Product/List.php class by Mynamespace_BigFinder_Block_Catalog_Category_View, and not by Mynamespace_Robots_Block_Catalog_Category_View.

How can priorize my rewrites ?

Thanks a lot


texts: Magento 2: Check the status before customer login

texts:
I have to add a user is active or not check before the user login for any place in my site. How can I do it? I mean which module or function need to override in my site.

Please help me to solve this issue.


texts: Search not displaying results when html special characters used

texts:
On our store we have a category "Maços" and that word is also on description of many products.

When this word is searched no results are found. I already went to catalog search options and tried the options "LIKE" and "Fulltext" and both combined with no luck...

What you do when you face this situation?


texts: Magento 2 where session data is stored (see example)

texts:
I'm trying to figure out how magento is hiding quote ids on client side
I've checked quote mask ids table, but this id is not there, so leaves me to guess its in session data "jQuery.localStorage.get('mage-cache-storage')" which gives a cart id thats not in quote table.

Thanks in advance.


texts: Changing Newsletter Subscribe Success Email

texts:
How do I change the email in the Newsletter Subscribe Success Email? The one on the from on the email being received. I would also like to change  the "Newsletter success subscription" text. Is that possible?

Refer to the image below:


texts: create new product attribute returns fault code 104 (Incorrect attribute type)

texts:
I am trying to create product attributes by SOAPV2 with method catalogProductAttributeCreate / Magento Community ver. 1.7.0.2

I have already debugged /core/Mage/Catalog/Model/Product/Attribute/Api.php` where this API call, string attribute_code & array frontend_label are fields that may not be empty.

Magento returns fault code 104 (Incorrect attribute type) with this XML:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:Magento" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://xml.apache.org/xml-soap" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
        <catalogProductAttributeCreate xmlns="urn:Magento">
            <sessionId xsi:type="xsd:string">a30c8633e591dad15a3eb67d8912f7c3</sessionId>
            <data xsi:type="ns1:catalogProductAttributeEntityToCreate">
                <attribute_code xsi:type="xsd:string">testattribute</attribute_code>
                <scope xsi:type="xsd:string">store</scope>
                <default_value xsi:type="xsd:string"/>
                <frontend_label xsi:type="ns1:catalogProductAttributeFrontendLabelEntity">
                    <store_id xsi:type="enc:string">0</store_id>
                    <label xsi:type="enc:string">Test label</label>
                </frontend_label>
            </data>
        </catalogProductAttributeCreate>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Why does Magento returns fault code 104? How can I created a attribute by SOAPV2 XML?

UPDATE

Still one question left for method catalogProductAttributeUpdate similar to catalogProductAttributeCreate

The product attribute label is updating with value "0", I expect "testlabel".

What is the correct XML / SOAPV2 ?


texts: What Magento 2 directories can be safely deleted from a production deployment?

texts:
We're using a CI process to deploy Magento 2 to a server when a change happens in the repository. Due to the sheer size of the Magento 2 codebase, this can take quite some time.

Improving the CI process is not really an option in our organization, so I'm wondering if I can delete some of the Magento 2 files that aren't really needed in a production deployment.

The first ones that come to mind are /dev and /phpserver.

Questions:

Will deleting these directories cause issues in production?
Are there other directories we can remove to save time and space?


texts: Exclude CSS/JS file For IE browser from magento 2 XML

texts: How can i exclude a CSS file from XML for IE browsers


texts: Wrong File Error Resize Image Magento 2.3

texts:
I just migrated from Magento 1.9.3.8 to Magento 2.3.4, then i copied the image from Magento 1.9 media to Magento 2 media, i noticed product images still not showing in my Magento 2 frontend, then i run:
php bin/magento catalog:images:resize

Wrong file
libpng warning: iCCP: known incorrect sRGB profile

I already clean the cache , delete the cache file , reindex, but still same error
Updated
i've fixed the libpng error by running, but the wrong file error still exists
find pub/media -type f -iname '*.png' -exec pngcrush -ow -rem allb -reduce {} \;

When i look up the file that causes this error, turns out the file does not exist


texts: Magento 2 add Sort By Best Sellers Option on category products litsing page

texts:
I am trying to add new custom sort by option on categories products listing page along with other existing options like Name , Position and Price.

To test my functionality i am directory doing changes to Magento core files Just for testing purpose , so that once it will work , i will create a separate custom module for that.

I have modified

  vendor/magento/module-catalog/Block/Product/ListProduct.php

and i have added

  $collection->getSelect()->joinLeft(
             array("test" => 'sales_order_item'),
             'main_table.entity_id = test.product_id',
             array('qty_ordered'=>'SUM(test.qty_ordered)'))
              ->group('main_table.entity_id')
              ->order('qty_ordered ASC');

Just after this line.

  $collection = $this->_getProductCollection();

In below function

  protected function _beforeToHtml()

But i am getting error as

  SQLSTATE[42S22]: Column not found: 1054 Unknown column
  'main_table.entity_id' in 'on clause'

Can anybody please help , where i am wrong and is there any better method to complimenting sort by best sellers option in Magento 2.

Thanks


texts: How to generate magento reports from one of my observer class?

texts:
Is it possible to generate csv/excel report from one of my observer class ?
eg - Abandoned Cart items

So If I can generate the csv/excel file then I can send it via email to users/developers.


texts: How Can I Show My Custom admin module's field's data in frontend (in a popup) in magento 1.9?

texts:
I have a custom module admin side created by me via an extension of module creator.

My module has some fields and one field is type editor i.e. the field having WYSIWYG editor.
I want to fetch its data whatever it contains Image or Text or Both and show it in a pop.

Data Stored in database like :

<img src="{{media url="wysiwyg/test-image.jpg"}}" alt="" />
Welcome to our store.

Let me suggest how can I achieve this.


texts: Magento2 custom attribute for specific product type

texts:
When creating attribute I notice that in magento2 no option for the select product type.

i.e I want my attribute will available for configurable product only.

But that attribute is visible for all simple product too.

Even I create a custom attribute when creating adding a configurable product.

When adding a simple product why that attribute is visible?

* How to create an attribute for configurable product only?


texts:
CentOs 7 with php 5.6.26 and Plesk 12.2

[php.ini]

Memory_limit 2G

phpinfo() shows memory_limit of 2G.
Readyness check still says limit is set to 128M, so I did a reboot and performed an cache:clean and flush on magento, still same result.

I came accross the .htaccess memory_limit, increased it there as well, and repeatet steps above, doesnt work out.

Any suggestions? Do I miss something here?


texts: How to add downloadable product in bundle items magento

texts:
I want to add downloadable products into bundle items.
For that I have changed/add downloadable tag in Mage_Bundle module in config.xml

-allowed_selection_types

simple

virtual

downloadable

allowed_selection_types

But it wasn't allow me to select products in bundle item selection. I am using magento 1.9.0.1
Can you please anyone assist for this problem.


texts:
my copy of magento 2 is broken and I can't retrieve it. I would like to do a new installation but I would like to keep the data (products, categories, set of attributes). How could i move that data from the old database to the new one?
thanks


texts: In Google Search Google Takes Meta Description or Products Description?

texts: What google takes, sometimes my meta description shown and sometimes products description shown.


texts:
In my Magento 1.9 installation I have an observer that observes the event sales_order_invoice_pay. When this event triggers I'm attempting to store the invoice's ID in a custom model I've created.

Here's how I'm getting the invoice from the event: $invoice = $observer->getEvent()->getInvoice();

However, when I attempt this using: getId(), getData('entity_id'), getIncrementId(), or getOrigData('entity_id'), I receive a null value.

It's important for me to store this specific invoice id as I'm using it later to load that invoice and create a shipment for items invoiced.

Is there anyway for me to get the ID?


texts: Magento1.9 : Translate validation messages for different stores

texts:
In my having two stores France and German.I want to validation error messages with their particular languages.How can I do it with my Js script?

My code

       <?php echo $this->__('Sample');?>*
       <input type="text" name="sample" id="sample" class="input-text required-entry" >
       <?php echo $this->__('test');?>*
       <input type="text" name="test" id="test" class="input-text required-entry validate-digits"  maxlength="4" >

Js Code

     //<![CDATA[
   var brochureform = new VarienForm('form');
    //]]>


texts: Why use createBlock() and setTemplate() methods over creating a block via .xml file in /layout subdir?

texts:
I've seen examples in extensions and in core where blocks are created through PHP code, e.g. in a controller action:

$block = $this->getLayout()->createBlock("company_module/...");

Or a block sets its own template, usually in the _construct()

$this->setTemplate("... .phtml");

I can see the programmatic approach being necessary if there is business logic involved that decides which block to create (or perhaps not create) and which .phtml template to set, depending on the circumstances.

But there are plenty of examples where there appears to be no business logic involved, yet the developer decided NOT to use the declarative approach of the .xml

Why would one want to NOT use .xml for creating blocks? What is best practice?


texts: How can I display product attribute in order summary in Magento2?

texts: I am trying to display weight of the products in the order summary like I have shown in the below screenshot. Anyone who knows help me out.


texts: JS mixin on a js file with a single return in Magento 2

texts:
I'm having trouble with mixin in Magento 2. I would like to override the following file to edit a function.

Magento_Checkout/web/js/model/new-customer-address.js:

define([
        'underscore'
    ], function (_) {
        'use strict';

        /**
         * @param {Object} addressData
         * Returns new address object
         */
        return function (addressData) {
            // ...

            return {
                // .....

                isEditable: function () {
                    return true;
                }

                // ....
            }
        }
    });

I would like to edit isEditable function so I have:

isEditable: function () {
    return addressData.is_editable !== undefined && addressData.is_editable == true;
}

I'm trying to extend it with a mixin like this:

define(function () {
    'use strict';
return function (target) { // target == Result that Magento_Checkout/js/model/new-customer-address' returns.
    console.log(target.addressData); // Undefined
    return target;
};
});

Can someone tell me where I'm wrong please ?


texts: How to use symbolic(symlinks) files in root directory - Change header and footer for second store

texts: I have created symbolic(symlinks) files for multi-store, how can i change the header and footer for my second store?


texts: Can't getName from CategoryCollection while getId and getUrl work

texts:
I cant seem to get Category name while i can Get Id and URL am i doing something wrong?

Layout (catalog_product_view.xml)

<block class="Magento\Catalog\Block\Product\View" name="product.category" template="productCategory.phtml"/>

Template

<?php
  $_product = $block->getProduct();
  $categoryCollection = $_product->getCategoryCollection();

  foreach ($categoryCollection as $value) {
      echo $value->getUrl(); // This returns correct Urls
      echo $value->getId(); //This return correct Ids
      echo $value->getName(); // This returns Null
  }
  ?>

EDIT

Have tried and not showing null

$value->getData()
$value->getPath()
$value->getParentCategory()->getName()

I'm finding this very confusing, as how i can return almost anything except name

Im doing this in magento 2.


texts: How to continue showing loader in Magento 2 on Checkout?

texts:
When the customer clicks on the submit button on the last page of the checkout in Magento 2, the screen grays out and the loader starts. Before finishing the request, the screen goes back to normal and magento hides the loader.  Many times, the customer thinks that the order has been processed, but the request still requires another 2-3 seconds before it's fully executed.

I want to know how I can keep the loader active until the request is fully executed.


texts:
I am trying to create a new block for footer in page.xml

steps done are

<block type="page/html_newfooter" name="newfooter" as="newfooter" template="page/html/newfooter.phtml"> added in page.xml

copied the Mage/Page/Block/Html/Footer.php to 'local/Mage/Page/Block/Html/' and renamed to 'Newfooter.php' and renamed the class accordingly

<block type="page/html_footer" name="footer" as="footer" template="page/html/footer.phtml">

remains untouched in page.xml

the idea is to call two footers in two different layouts

I am calling new footer like following getChildHtml('newfooter') ?> in my new layout

But its not working as expected . In both of my layouts either footer loads or newfooter loads irrespective of the layout i have selected for my pages.

I am refreshing cache every time. so that is not the issue

I think it is cache issue. After clearing cache if i load a page with footer then from there onwards all the pages will load footer. But if i load a page with newfooter then from there onwards all pages will load newfooter

I tried changing the cache_tags value in _construct
but not getting the result


texts: Some simple products not add in the Bundle Products

texts:
I have to try to add some simple products into Bundle Products,
but whenever I search for that simple product is not display in the product listing.
I don't know why I have searched for any error, I have seen in the Logs, but in logs, there is no any kind of related entries to this issue.
Bundle Product SKU is : 0850DVD
Simple Product SKU is : 0850ADV,0850BDV,0850CDV,
please help with this, what should I miss in product configuration


texts:
In customer account address book, add or edit address is managed in separate page.

I want to add or edit address in popup modal(same like shipping address popup modal in checkout page)*.

How it can be done ?


texts:
I have created an attribute 'priceless' and I have successfully removed the add to cart button based on whether it is set to 'yes' or 'no'.
I wish to do the same for the price field. If attribute 'priceless' is 'yes' then don't show price.
Can anyone please help with the file I would update to get this functionality working?
Here's the code that worked to check the setting in the addtocart.phtml <?php if($_product->getPriceless()): ?> is there an equivalent phtml file for price?


texts: Magento 2 add label out of stock products in configurable product dropdown

texts:
There are some related messages but not precisely this.

Is there an method to - show out of stock products (for a configurable product) - add a label "out of stock"

So a drop down with

XS
 SM
L

becomes

XS
 SM
L - out of stock

Help appreciated.


texts: Upgrade magento 2.2.2 to 2.3.2 getting error

texts:
We are trying to upgrade a Magento 2.2.2 site to Magento 2.3.2, when executing **php bin/magento indexer:reindex** we get the error...

Design Config Grid index has been rebuilt successfully in 00:00:00
Customer Grid index is locked by another reindex process. Skipping.
Category Products index has been rebuilt successfully in 00:00:04
Product Categories index has been rebuilt successfully in 00:00:00
Catalog Rule Product index has been rebuilt successfully in 00:00:00
Product EAV index has been rebuilt successfully in 00:00:01
Stock index has been rebuilt successfully in 00:00:00
PHP Fatal error:  Uncaught Error: Call to undefined method Magento\Catalog\Model\ResourceModel\Product\Indexer\Price\SimpleProductPrice::reindexAll() in /var/www/html/app/code/Bss/MultiStoreViewPricingPriceIndexer/Model/Indexer/Product/Price/Action/Full.php:51
Stack trace:
#0 /var/www/html/vendor/magento/module-catalog/Model/Indexer/Product/Price.php(66): Bss\MultiStoreViewPricingPriceIndexer\Model\Indexer\Product\Price\Action\Full->execute()
#1 /var/www/html/vendor/magento/module-indexer/Model/Indexer.php(416): Magento\Catalog\Model\Indexer\Product\Price->executeFull()
#2 /var/www/html/vendor/magento/module-indexer/Model/Indexer/DependencyDecorator.php(248): Magento\Indexer\Model\Indexer->reindexAll()
#3 /var/www/html/vendor/magento/module-indexer/Console/Command/IndexerReindexCommand.php(87): Magento\Indexer\Model\Indexer\DependencyDecorator->reindexAll()
#4 /var/www/html/vendor/symfony/console/Command/Command.php(255): Magento\Indexer\Console\Command\IndexerReindexCommand->execute(Object(Symfony\Component\Console\Input\Argv in /var/www/html/app/code/Bss/MultiStoreViewPricingPriceIndexer/Model/Indexer/Product/Price/Action/Full.php on line 51

the error message
enter link description here


texts: Credit Memo is not working in Magento 1.8.1

texts:
I am facing an issue while creating an Credit memo for a order. I am getting error as "Argument 'Invoice number' not set!".

This order has been placed through PayPal.

Please help to fix this issue.


texts: Magento 2 get and set Qty of product with observer

texts:
I tried my code below to get Qty from observer when a page loaded :

Observer :

public function execute(\Magento\Framework\Event\Observer $observer) {
    $collections = $observer->getEvent()->getCollection();
    foreach( $collections as $collection ) {
        var_dump($collection->getQty());
    }
}

events.xml :

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
  <event name="catalog_product_collection_load_after">
    <observer name="loadupdates" instance="Test\Show\Observer\CustomPrice" />
  </event>
</config>

But, i got all NULL for getQty of products. So my question, how can i get the Qty of products, and how to update the Qty from the observer?


texts:
How can I preload the Upselling products with ajax (after loading all the elements of the page).

It is also possible to use prototype for that ? If yes how to proceed to do that task ?

Thanks for help.


texts: Magento 2 Which Index should set "Index By Schedule" or "Update On Save" for performance purpose?

texts:
I have a site with Magento 2.3.3 version with over 10000 catalog products.
For performance purposes which Indexer should set "Update on Save" or "Update On Schedule".

Thank You.


texts: Magento2 hide flat rate shipping for particular category products

texts:
Magento2 How can I hide flatrate shipping for particular category products?
Any advice will be appreciable


texts:
I am using Magento 1.9.0.1 and I am having issues with the PayPal IPN. Its currently set to be https://www.example.co.uk/paypal/ipn.

1) Is https://www.example.co.uk/paypal/ipn the correct address to use?

2) How can I start to debug this issue as PayPal as saying its a issue with the website


texts: Upgrade to magento 2.3.2 suddenly shows wrong / duplicate labels on default checkout

texts: I upgraded magento 2.3.0 to magento 2.3.2 and now it shows the tooltip label and a strange street address: line 1 label in the default checkout. Do not want to hide it with css but a real solution would be great.


texts: overwrite default product list with help of extension

texts:
I want to add content in product list page. For this i followed creating extension for product list

For example here http://localhost/magento_ce222/women/tops-women/jackets-women.html i want some content / block in each product. I can able to add block in product detail page. With this link amasty helloworld extension

This link also helped. But i cant find solution
Cannot overwrite product list template in catalog_category_view