texts: Cart lost for logged in customer. Retrieved only after adding item

texts:
We run a B2B webshop in Magento 2.3.5 and customers have to log in to be able to add items to the cart (Amasty Hide Price-module). However we are experiencing problems with disappearing carts:

Customer logs in
Customer places several items in cart.
Customer logs out / is logged out after some time.
Customer logs back in: cart is empty.
Customer places random item in cart: this item is in the cart together with the previously entered items.

I think it is a session / cookie issue but I can't quite figure out what / why this is happening and how to solve it. Any help would be greatly appreciated!


texts: Magento 2: Sort order and limit product collection

texts:
I need to sort the product collection by ID order DESC and add limit to product collection. Here is my code:

$objectManager     = \Magento\Framework\App\ObjectManager::getInstance();
$productCollection = $objectManager->create('Magento\Catalog\Model\ResourceModel\Product\CollectionFactory');
$collection        = $productCollection->create()
    ->addAttributeToSelect('*')
    ->load();


texts:
Magento 2.3.1 / Windows 10 / WAMP64

Start Magento Admin / System Upgrade

ERROR:

"PHP Settings Check

Your current PHP memory limit is 2G.
Magento 2 requires it to be set to 756M or more.

As a user with root privileges, edit your php.ini file to increase memory_limit.

(The command php --ini tells you where it is located.) After that, restart your web server and try again"

I set memory limit 6G in the php.ini & htaccess & user.ini files.

No result.

Can help to me ?


texts: Blog Post Title and Read more Button doesn't link to post

texts:
I'm using Magento 1.9 and have a blog setup but whenever i create a post the post itself doesn't link to a separate page containing the full post instead of redirects to the index page. See below for an example:

http://website.co.uk/blog

the post should be linked to the following link:

http://website.co.uk/blog/test

but as you can see it says 404 Not Found yet the post exists in the Backend.


texts: How to use Magento2 when cloned from git repo?

texts:
There is a warning in the Magento2 installation instructions that I don't understand. It says:

If you clone the Magento 2 GitHub repository, you cannot use the Magento software in a production environment.
You cannot have a live store that accepts orders and so on.

I'm confused because this is something that I've been doing for the past year and it works, but they say that it cannot be used.

We cloned the git repo when Magento 2.0.0 came out, and have been updating it and have modified the code extensively by creating dozens of modules. We're now on 2.1.2.

What do they mean with this warning? Is this a license issue/restriction rather than a technical one? What's the reason for this?


texts: Magento 2 PHP Fatal error: Class not found when compiling

texts:
When I compile I get this error:

PHP Fatal error:  Class
'Magento\Catalog\Controller\Adminhtml\Category\Image\Upload' not found
in
/var/www/html/magento/app/code/Plazathemes/Override/Controller/Adminhtml/Category/Image/Upload.php
on line 11

EDIT with the code:

Still unable to fix can someone write the soltion to fix this.


texts:
I'm new to magento.
when i want to install an extension i get the following message:
community/Locale_Mage_community_fr_FR: Couldn't resolve host 'connect20.magentocommerce.com'

How do I resolve this?

Tns


texts: Getting always NULL in Cart Item GetPrice() function

texts:
I'm manually adding some products to the cart:

$product = Mage::getModel('catalog/product')->load(113);
$params = array(
  'product' => 113,
  'qty' => 1
);
$request = new Varien_Object();
$request->setData($params);
$cartHelper->getCart()->addProduct($product, $request);

But the price is always empty (or null).

I've been debugging the execution through

Mage_Checkout_Model_Cart->addProduct(...)
Mage_Sales_Model_Quote->addProduct(...)
Mage_Sales_Model_Quote->addProductAdvanced(...)

and finally:

protected function _addCatalogProduct(Mage_Catalog_Model_Product $product, $qty = 1)
{
    $newItem = false;
    $item = $this->getItemByProduct($product);
    if (!$item) {
        $item = Mage::getModel('sales/quote_item');
        $item->setQuote($this);
        if (Mage::app()->getStore()->isAdmin()) {
            $item->setStoreId($this->getStore()->getId());
        }
        else {
            $item->setStoreId(Mage::app()->getStore()->getId());
        }
        $newItem = true;
    }

    /**
     * We can't modify existing child items
     */
    if ($item->getId() && $product->getParentProductId()) {
        return $item;
    }

    $item->setOptions($product->getCustomOptions())
        ->setProduct($product);

    // Add only item that is not in quote already (there can be other new or already saved item
    if ($newItem) {
        $this->addItem($item);
    }

    return $item;
}

But the price is not there, in that $item :(

Any help would be much appreciated.


texts: Magento2.4.0 - Catalog search index process unknown error

texts:
I am getting a catalog search index process unknown error when I run

php bin/magento indexer:reindex

I don't know how to solve this. I have successfully connected to Elasticsearch 7 on admin panel.
Attached is a screenshot.


texts: What is the best way to save data in cron file in Magento 2?

texts:
I have a multistore website. Every store has a different language.
When I save data by running a cron file.

It saves the data in the English language but data does not save as per multilanguage. How to solve it?


texts: Magento 2: The direct use of ObjectManager is discouraged

texts:
when I am check using object manager it gives me warning that The direct use of ObjectManager is discouraged. Inject necessary dependencies via constructor". How to solve this problem and I also want to know that how to call block file's objectmanager in template file. I am checking customer is login or not using below code.

    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $customerSession = $objectManager->get('Magento\Customer\Model\Session');
       if ($customerSession->isLoggedIn()) {
           //my custom code goes here;
        }

I am already using below way but it doesn't work for me.

     private $_objectManager;

    public function __construct(
    \Magento\Framework\ObjectManagerInterface $objectmanager)
    {
     $this->_objectManager = $objectmanager;
    }

   $customerSession = $objectmanager->get('Magento\Customer\Model\Session');
           if ($customerSession->isLoggedIn()) {
               //my custom code goes here;
            }


texts: Moving Magento 2 to local system perform extremely slow

texts:
I have developed a custom theme using magento 2 and I have deployed it in a shared hosting one year ago. Meanwhile I've did multiple updates in my local computer (Mac using AMPPS server) and I deployed them using git to production.

Recently I decided to export the entire production environment and deploy it in my local computer in order to copy historical data about products, orders, users etc.
After importing the database and local folder structure the website started working extremely slow in my local machine. By slow I mean that it takes more than 4-5 minutes for switching between pages for both frontend and backend.

I tried a lot of things last couple of days - I was playing with the cache, i was changing the modes between developer and production, I tried to switch on and off the css/javascript merging, I build everything with grunt, I even tried to install a new MAMP server and run the website under nginx, but nothing helped.

Can someone help me to find a solution of the problem?


texts: Magento 2 - 3rd level menu items collapsed on mobile devices

texts:
a quick question:

The appearance of the menu on mobile devices in magento 2 is :

with the 3rd level menu expanded by default.

Is there a way to make the 3rd level menu collapsed by default? something like this:


texts: Programatically transefer cart items to another user

texts: I want to transfer  cart items from one user to another programatically.Like all items of user 'A' should be transferred to cart of user 'B'. I tried to update customer_id in sales_flat_quote table but it din't solve the problem. How to do that ?


texts: Multi store setup with sub domains, MAGE_RUN_CODE not working

texts:
After reading some articles to setup multi store, I have created a new directory containing index.php and .htaccess files along with symlinks for pub, var and generated folders.

Here is updated index.php code:

$params= $_SERVER;

$params[\Magento\Store\Model\StoreManager::PARAM_RUN_CODE] = 'b2b';
$params[\Magento\Store\Model\StoreManager::PARAM_RUN_TYPE] = 'website';
$bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $params);

For some reasons this has not been working, I also tried this code in index.php of root directory.

I'm trying to debug it but couldn't find any reference of these "MAGE_RUN_CODE" and "MAGE_RUN_TYPE" keys in magento.

I'm wondering How magento is handling this store switching from these keys in $_SERVER attribute.

Any help is highly appreciated. Thanks


texts: Warning: openlog() has been disabled for security reasons in Magento2.3

texts:
I have upgraded magento 2.2.7 to 2.3.0 using composer, now when i run any command in SSH it throws an error and can not execute it:

  openlog() has been disabled for security reasons


texts: How to add input form to custom checkout step in magento 2

texts:
I created new checkout step in magento 2 using this link custom checkot step
Now I have only a button on my new step which is declared here in mystep.html

        <form data-bind="submit: navigateToNextStep" novalidate="novalidate">

                    <button data-role="opc-continue" type="submit" class="button action continue primary">

                    </button>

        </form>

Now I want to add 2 input field like dropdown button and radio button, but if I try to insert just a simple input in my mystem.html nothing happen!
what is the normal way to add custom inputs in the checkout custom step, and how can I save the values after I will create my input?
Thank you!


texts: Magento change grand total & subtotal of an order

texts:
I am creating an order from existing order.

    $order = Mage::getModel('sales/order')->load(230);
    $order->setReordered(true);

    $quote = $this->getQuote()->setUpdatedAt(now());
    $quoteCurrency = Mage::getModel('directory/currency')->load($quote->getQuoteCurrencyCode());
    $quote->setForcedCurrency($quoteCurrency);
    $quote->save();

I am using this "$quote" object to create an order.

Order is creating perfectly. But now I want to update the grand total & sub-total of only newly created order.

I tried below with both $quote & $order object but no success.

    $order->setSubtotal(39.99);
    $order->setBaseSubtotal(39.99);

    $order->setShippingAmount(4.99);
    $order->setBaseShippingAmount(4.99);

    $order->setGrandTotal(39.99 + 4.99);
    $order->setBaseGrandTotal(39.99 + 4.99);

    $order->setBaseTaxAmount(0);
    $order->setTaxAmount(0);

Any idea how to do this.


texts: Event equivalent to controller_front_init_before from magento 1 in magento 2?

texts:
I'm using controller_front_init_before in Magento1.But I want to use the same event in magento2.

Which event is equal to this event name? If anyone knows please explain me...


texts: How to show subcategories even if parent category is disabled?

texts:
How can I show the subcategories in the frontend even if the parent category is disabled?

Suppose I have categories like following

Electronics
           Cell phones
                      Accessories
                      Digital Camera
           Cameras

I Cellphone category is disabled, is it possible to still show the sub categories Accessories and Digital Camera, under Electronics category?


texts: Magento 2 - Empty Cart and Quote behaviour

texts:
When the session quote has no visible items should it be set as inactive or still kept as active?

Does anyone know how to do it? Thanks in advance.


texts:
When I try to reindex the product attributes, as you may expect, it gives me the following error "There was a problem with reindexing process."

On the Mage_Index_Adminhtml_ProcessController, line 133, I was able to retrieve the error (via $e->getMessage()), but now I don't realy know how to fix it.

SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`catalog_product_index_eav`, CONSTRAINT `FK_CAT_PRD_IDX_EAV_ENTT_ID_CAT_PRD_ENTT_ENTT_ID` FOREIGN KEY (`entity_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE C)

Can you please point me on the right direction ?


texts: how to show all (or many) Attributes in Description.phtml?

texts:
I wish to show attributes (file: attributes.phtml) content in Description.phtml ,somebody answer but i find it is not the key.
 here is the two files:

    <?php
        $_helper = $this->helper('catalog/output');
        $_product = $this->getProduct()
    ?>
    <?php if($_additional = $this->getAdditionalData()): ?>

<?php echo $this->__('Additional Information') ?>

    <?php foreach ($_additional as $_data): ?>
    <?php $_attribute = $_product->getResource()->getAttribute($_data['code']);
    if (!is_null($_product->getData($_attribute->getAttributeCode())) && ((string)$_attribute->getFrontend()->getValue($_product) != '')) { ?>
   <?php echo $this->htmlEscape($this->__($_data['label'])) ?>
     <?php echo $_helper->productAttribute($_product, $_data['value'], $_data['code']) ?>

    <?php } ?>
    <?php endforeach; ?>

<?php endif;?>

    <?php $_description = $this->getProduct()->getDescription(); ?>
<?php $_helper = $this->helper('catalog/output'); ?>

<?php if ($_description): ?>

<?php echo $this->__('Details') ?>

 <?php echo $_helper->productAttribute($this->getProduct(), $_description, 'description') ?>

<?php endif; ?>


texts: Magento 2.3 Hook an event in 'Submit Shipment' process in Sales Order View(Adminhtml) — New Shipment Form

texts:
I want to hook some event on Submit Shipment button in Sales Order View New Shipment Form.
I want the event to hook when admin clicks on Submit Shipment button.

Has anyone tried to do it before? Which file should be overridden?
Any reference please.

Please check the image below:


texts:
I'm working on a site that has 3 root categories, one per store in the Magento installation.

On the categories page (Catalog > Manage Categories) I can see the category ids and the number of products they have respectively.

Category1 - Id: 6  - store: 3 - 11 products
Category2 - Id: 10 - store: 4 - 11 products
Category3 - Id: 14 - store: 5 - 11 products

I've used the CMS to distinguish the content at the store-view level for each store. For example, on the store for the first category, I have this (filtering the products to category 6)

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" category_id="6" template="catalog/product/list.phtml"}}

However, all 33 products are being displayed. Any idea why products from the other categories are being displayed?

Update

I've been digging more and it looks like it has something to do with product indexing in Magento. Here's the query that's erroneously selecting 33 products

SELECT `e`.*,
       `cat_index`.`position` AS `cat_index_position`,
       `price_index`.`price`,
       `price_index`.`tax_class_id`,
       `price_index`.`final_price`,
       IF(price_index.tier_price IS NOT NULL, Least(price_index.min_price,
                                              price_index.tier_price),
       price_index.min_price) AS `minimal_price`,
       `price_index`.`min_price`,
       `price_index`.`max_price`,
       `price_index`.`tier_price`
FROM   `catalog_product_entity` AS `e`
       INNER JOIN `catalog_category_product_index` AS `cat_index`
               ON cat_index.product_id = e.entity_id
                  AND cat_index.store_id = 3
                  AND cat_index.visibility IN( 2, 4 )
                  AND cat_index.category_id = '6'
                  AND cat_index.is_parent = 1
       INNER JOIN `catalog_product_index_price` AS `price_index`
               ON price_index.entity_id = e.entity_id
                  AND price_index.website_id = '1'
                  AND price_index.customer_group_id = 0

I've verified store_id=3 is correct (as well as category_id=6 like I mentioned earlier). If I query the catalog_category_product table directly, it meets expectations, there are 11 products.

SELECT Count(*)
FROM   catalog_category_product_index
WHERE  category_id = 6
       AND store_id = 3;

However, if I query catalog_category_product_index with the relevant filters from the large query Magento is running, there are 33 products.

SELECT Count(*)
FROM   catalog_category_product_index
WHERE  category_id = 6
       AND store_id = 3
       AND is_parent = 1
       AND visibility IN ( 2, 4 );

I reindexed everything under Index Management and that had no effect.

Better Update

There is something definitely spurious going on with the indexing, I've narrowed the issue even further.

Directly selecting from catalog_category_product

SELECT category_id
FROM   catalog_category_product
WHERE  product_id = 3445;

Result

+-------------+
| category_id |
+-------------+
|          10 |
|          13 |
+-------------+

Selecting from catalog_category_product_index

SELECT category_id
FROM   catalog_category_product_index
WHERE  product_id = 3445
GROUP  BY category_id;

Result

+-------------+
| category_id |
+-------------+
|           2 |
|           6 |
|          10 |
|          13 |
|          14 |
+-------------+

Somehow Magento's catalog indexing process is erroneously saying this product is in categories 2,6 & 14, when in point of fact, it's not! Any idea what could be wrong??


texts: Magento transactional email shows and old template even after styling it

texts:
I made some inline styling changes on a Transactional Emails template. My changes are visible when I preview the Transactional emails template.
but the problem is when I send a test email to a gmail I still get an old version of the Transactional email template. My new changes don't show up.
I cleared the cache and I did Reindexing. but my My new Transactional email template doesn't show up.

Is there a step that i'm missing? or Is this problem related to Magento or the Server?


texts: Product image is not loading in product discription page in Magento 2.1.7

texts:
I am facing some problem here the images in the product description is not loading at all. But it is loading well in the category page.

site link

Please hint that what I can do to solve this problem, I checked some article nothing helps me.

Thanks in advance.


texts: New Shipping method but Shopping Cart Price Rules is not appllied

texts:
Following this tutorial https://code.tutsplus.com/tutorials/create-a-custom-shipping-method-in-magento--cms-23747 i have created a new shipping method

and the price, following the tutorial, has been set up in the file config.xml

<?xml version="1.0"?>
<config>
  <modules>
    <Envato_Customshippingmethod>
      <version>1.0</version>
    </Envato_Customshippingmethod>
  </modules>
  <global>
    <models>
      <envato_customshippingmethod>
        <class>Envato_Customshippingmethod_Model</class>
      </envato_customshippingmethod>
    </models>
    <helpers>
      <envato_customshippingmethod>
        <class>Envato_Customshippingmethod_Helper</class>
      </envato_customshippingmethod>
    </helpers>
  </global>
  <default>
    <carriers>
      <envato_customshippingmethod>
        <active>1</active>
        <sallowspecific>1</sallowspecific>
        <model>envato_customshippingmethod/demo</model>
        <name>Demo Shipping Method One</name>
        <price>8.53</price>
        <title>Demo Shipping Method</title>
      </envato_customshippingmethod>
    </carriers>
  </default>
</config>

The new shipping method appear to work fine, without any kind of problem, but if i try to set up a checkout rule to put the shipping method free for order over 30,00€ the rules is not applied

Maybe is a problem of the new shipping method?....or maybe i wrong something in the rule?


texts:
Im having problem on integrating header mini cart into my custom theme. The mini cart is not showing the recently added items. Below are the screenshots of the issue. Any help is much appreciated.

Parent theme: Magento/Blank

Screenshots:

By the way I'm newbie for Magento 2.


texts: How to remove special price if qty is low?

texts:
How to remove special price if qty is low.

Instead of setting from and to date from advanced pricing, I need to remove special price based on if qty is lower.


texts: Adding custom css-files to theme (page.xml) - custom css-files for single storeviews

texts:
Question #1:
For some reason, I can't seem to get my custom CSS file to be implemented into the theme. I've basically done this with the page.xml:

Before:

<action method="addItem"><type>skin_css</type><name>css/styles-ie.css</name><params/><if>lt IE 9</if></action>
<action method="addItem"><type>skin_css</type><name>css/styles-iefont.css</name><params/><if>gt IE 6</if></action>
<action method="addCss"><stylesheet>css/widgets.css</stylesheet></action>
<action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action>
<action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action>
<action method="addItem"><type>skin_js</type><name>js/ie6.js</name><params/><if>lt IE 7</if></action>

After: (added inbetween)

<action method="addCss"><stylesheet>css/widgets.css</stylesheet></action>
<action method="addCss"><stylesheet>css/print.css</stylesheet><params>media="print"</params></action>

<action method="addCss"><stylesheet>css/hafner.css</stylesheet><params>media="screen"</params></action>
<action method="addItem"><type>skin_css</type><name>css/hafner.css</name></action>

<action method="addItem"><type>js</type><name>lib/ds-sleight.js</name><params/><if>lt IE 7</if></action>
<action method="addItem"><type>skin_js</type><name>js/ie6.js</name><params/><if>lt IE 7</if></action>

Am I missing something?

The code is in <block type="page/html_header" name="header" as="header">

Question #2: (the relevant one)

How to add custom CSS-files for single storeviews?

Answered by Jonathan Hussey (see below)

edit02: it seems I don't get it quite just yet.

</default>

<!-- CUSTOM -->
<STORE_hafner_de>
    <reference name="header">
        <action method="addCss"><stylesheet>css/hafner.css</stylesheet><params>media="screen"</params></action>
    </reference>
</STORE_hafner_de>

that </default> is just to show that <default> is closed


texts: Magento 2: Admin Customer Listing Not Displaying Record

texts:
I have an entry of 54K users in Customers. In Database customer_entity table it's showing count.

It's working an hour before. Suddenly it's not displaying in Admin Customer Listing. Trying to search as well. Still not displaying record.

I have cleared cache as well. No errors in Log

What's the reason behind this issue or why it occurs? Because Magento behaves strangely.


texts: Generation of var/cache/ var/generation and var/di folders Magento2

texts:
I have a very simple question. Which magento commands cause the removal of

var/cache/
var/generation/
var/di/

Folders and which bin/magento commands create them again.


texts:
This is a really odd problem that I can't seem to find the answer anywhere - any help would be greatly appreciated.

I'm trying to run a sales report by a daily basis however this morning I had this problem - the reports would be a day off.

For example,
- > I go to extended orders
- > Put the dates as FROM: 2/25/15 TO 2/25/15 (To see only orders on this date)
- > However, it only shows orders in 2/26/15. I would try to see orders in only 2/26/15 and then it would show all orders for 2/27/15 and so forth.

I've only begun having this problem this morning.

Does anyone know how to fix this bug?


texts: My Database may have been affected by Shoplift vulnerability (SUPEE-5344)

texts:
I am trying to see all worst case scenario. My one of the site may have been shoplifted.

Now, I am in process of quarantine it first then start fresh site with fresh files.

However, I do need current database.

My main qst

Reported Shoplift or any other vulnerability on Magento would have infected the database?
How to quarantine DB? I have got really large DB.

Please suggest.


texts:
When I create a configurable product, sometimes it is saved with all attributes by default and other with their attributes. I put an example:

I have an attribute set "Example1" and this have custom attributes "Attribute1" and "Attribute2". Also I have attribute set "Example2" and this have the custom attributes "Attribute2", "Attribute3" and "Example4".
If I create one product with attribute set "Example1" sometimes save values for "Attribute1" and "Attribute2" and other time it save values for "Attribute1", "Attribute2", "Attribute3" and "Attribute4".

How and why?

Thanks!


texts: Post Magento 1.9 to 2.1 migration, cannot edit categories

texts: Migrated using the official data migration tool and everything seems fine except we cannot edit product categories in the admin panel. Every change we attempt to save results in page spooling and an eventual service 500 page. Anyone else get something similar? Where should I look to fix this problem?


texts: Magento 2 get admin base url in custom js

texts:
I have added custom js to create module for a functionality.
I need to call ajax in my custom js but I need Base url of admin in js file.
How I will get this?
I tried

function createBooking(){
    orderId =4;
if(orderId ==null){
    alert('Order id does not found')
    }else{
 require(['jquery'], function ($) {
                   $.ajax({
            url: {Here I need admin base url},
            type: 'POST',
            data: {isAjax: 'true', form_key: FORM_KEY,order_id:orderId}
        });
    });
             }    //else
} // createBooking


texts:
I am working with magento 1.9.2.2 and the  customer registration page shows duplicate state/province names suggestions .
I checked the database. Only single entry is present there in both

directory_country_region
directory_country_region_name

Still why registration page shows duplicate ? any clue ?


texts: Magento 1.7 Correct the US spelling of cheque on invoice

texts:
I need to correct the US spelling of check to the correct English spelling 'cheque' on the invoice generated by Magento.

Ive changed the payment method name and it all looks ok within the Magento admin area but when you go to print the invoice or order it adds an extra line saying 'Send Check to:' directly under the correct line 'Make Cheque payable to:'

Where can I change this?

Ive checked through all the local files but cant find any reference to it. I am also using the pdfcustomiser by fooman but again Ive looked through those files and there is no reference to the word 'check'

Can anyone help?

Thanks


texts:
What would be the best approach to making the main product image change base on the attribute choosen.

For example if the customer chooses colour blue for a t-shirt the main image would be swap to the image which I have marked as the blue t-shirt


texts: What is the best IDE for Magento development?

texts: Currently I'm using eclipse kepler as my IDE. Are there any better/more flexible IDEs available?


texts:
I want to add block in  tag. I dont want to add this script in Configuration > HTML Head >  Scripts and Style Sheets. Please check attached screenshot.

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="after.body.start">
            <block class="Magento\Framework\View\Element\Js\Components" name="frontuser" as="frontuser" template="Frontuser_Tags::frontuser/tags.phtml"/>
        </referenceContainer>
    </body>
</page>


texts: Magento 2. how to hide 'Add to cart button' using Plugins

texts: How to Hide 'Add to cart' button using Plugins.I'm stuck in to hide add to cart button.


texts: Call admin export product csv from code / URL

texts:
I'm looking for a way to call the magento export (System->Import/Export->Export) product export from an URL for a 3rd party system.
So I want something like
https://my.domain.com/bla/blub/export.php?filterAttribute=2
and that shall return a csv of all products with filterAttribute 2.
I managed to do this by using dataflow export and then readfile() to the client, just to realize that this is missing lots of attributes.

So, currently I basically do something like:

$profile = Mage::getModel("dataflow/profile")->load($profileId);
$adminUser = Mage::getModel('admin/user')->setUserId(0);
Mage::getSingleton('admin/session')->setUser($adminUser);
$profile->load($profileId);
$guiData = $profile->getGuiData();
$guiData['product']['filter']['filterAttribute'] = 2;
$profile->setGuiData($guiData);
$profile->save();
$profile = Mage::getModel("dataflow/profile")->load($profileId);
Mage::register('current_convert_profile', $profile);
$profile->run();
readfile($exportFile);

Now, how do I transfer this simple code to Import/Export?
Magento 1.9


texts: How to charge sales tax only if a customer is out of country and chooses specific shipping method?

texts:
Can someone tell me how and if it's possible in the magento 1.9.2 (x) admin, where I can setup a way to charge my NY sales tax on an order IF a customer is in Canada AND they choose a specific shipping method (in this case, I'm offering local pickup - but if they do this, I have to charge sales tax if they are picking up the item where I'm located).

Thanks.


texts: edit "Additional information" to an other name?

texts:
I would like to transform the "Additional information" to an other name like "feature". where file i will update or edit?

Thanks


texts: Using AWS S3 bucket to store media folder

texts:
I'm setting up a Magento site on AWS for the first time and want to use a S3 bucket with Cloudfront CDN.

I want to store the media folder in an s3 bucket so that I can scale out the servers and they will all use the same S3 bucket.  And use the CDN to speed up performance.

I've been doing a some research and it all recommends that I use an extension such a this one.

Why would I need to use an extension?  I thought I could simply set the Base Media URL to use our bucket URL to my Magento config at System > Configuration > Web

Do you just need to use an extension for the CDN part? i.e. can I use the s3 bucket by simply adding the configuration above?


texts: how to add negative qty product into cart in magento. 2

texts:
How to add a out of stock (less than 0 ) product in  shopping cart in magento 2

In my backorders setting  i have custom option as Allow pre-order  when  i  select a custom option and saved a backorder configuration  after that how to  add negative qty  product into cart  in magento.

Product edit page in admin

Store > configuration > catalog > inventory

I can't add a product into cart

Please some one help me to solve this


texts: Magento 2.2 Make custom tab disappear when specific attribute is not set

texts:
I created a custom product tab that I want to use for a specific attribute set. For that attribute set I have created a number of specific attributes.

The custom product tab works nice. However it is visible for every product, which is not wanted. How could I make sure that the tab is only visible for a specific attribute set (or product attributes for that matter).

My code:

app/code/[VendorName]/[ModuleName]/registration.php

<?php

\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Mark_Eopyy',
    __DIR__
);

app/code/[VendorName]/[ModuleName]/etc/module.xml

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="Mark_Eopyy" setup_version="1.0.0">

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

    </module>
</config>

app/code/[VendorName]/[ModuleName]/view/frontend/layout/catalog_product_view.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">

        <referenceBlock name="product.info.details">

           <block class="Magento\Catalog\Block\Product\View" name="custom.tab" template="Mark_Eopyy::custom_tab.phtml" group="detailed_info">
                <arguments>
                    <argument translate="true" name="title" xsi:type="string">ΕΟΠΥΥ</argument>
                </arguments>
            </block>
        </referenceBlock>

</page>

app/code/[VendorName]/[ModuleName]/view/frontend/templates/product/view/details/custom_tab.phtml

<?php
$product = $block->getProduct();
?>

<?php echo $product->getData('product_attribute'); ?>

Thank you


texts: Magento 2 - Category list for custom magento system configuration section

texts:
My problem to get all available categories and display them in a system config multi-select field list.

Here is a link for Magento 1.x. How can it be achieved for Magento 2.x?


texts: Magento1.9 jquery calendar not working properly

texts: I have added jquery calendar for a product to take date and time and kept as not required. If I add that product to cart without disturbing the date field its working.If I select date, time and trying add the product to cart means its showing field not complete. Can anyone help in this issue?


texts: Magento 2 - Object manager tries to instantiate Abstract class. ( Fatal error )

texts:
Playing around with Magento 2 but run into a problem I can not wrap my head around. The object manager tries to instantiate Abstract class, this gives an Fatal Error. Does someone know what might cause this or point me in the right direction?

The Error

Fatal error: Cannot instantiate abstract class Magento\Framework\Model\Resource\AbstractResource in /lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php on line 75

The Problem

My module has a model that extends the \Magento\Quote\Model\Quote. The constructor of this model has the following line injecting this:

\Magento\Framework\Model\Resource\AbstractResource $resource = null,.

The controller that is instantiating the model extends the \Magento\Backend\App\Action and uses $this->_objectManager->create() to instantiate the model.

The thing I can not wrap my head around is if I instantiate the Magento model it just works but if I instantiate my model it tries to instantiate this abstract class throwing the error above. What tells the object manager to do this and how can I solve my problem?

My first thought was Magento uses the di.xml to replace this, execute this or something, this was not the case.

Thanks for taking the time to read this. Any help or input on this issue is appreciated.


texts: How to get the product category id in the cart? Magento 2

texts:
How to get a list of product categories id in the basket?
Here I get the name of the product.

use \Magento\Checkout\Model\Session;
class Collect extends AbstractCarrier implements CarrierInterface
{
    protected $_code = 'chester_collect';
    protected $_session;
    public function __construct(
        Session $session,
        array $data = []
    ) {
        $this->_session = $session;
        parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);
    }

public function isActive()
    {
        /** @var $item \Magento\Quote\Model\Quote\Item */
        $items = $this->_session->getQuote()->getAllItems();
        foreach ($items as $item){
          var_dump($item->getName());
        }
    }

But how to get all the categories of goods that are in the basket?


texts:
I'd like to make available in checkout the opportunity for the customer to pay 25% of the total of the transaction. The rest of the payment would be taken offline (outside of Magento).

Can anyone advise on firstly, if this is possible, and secondly if there's anything I can add to the checkout.phtml to achieve this?


texts: Override customer listing magento2 - uicomponent

texts:
I need to change target of the customer grid of admin. The default is startEdit, but the client didnt like. He wants a link for customer edit in the row.

<item name="target" xsi:type="string">startEdit</item>

to

<item name="target" xsi:type="string">applyAction</item>

Only this. How I override this?

I try to create a customer_listing.xml in MyName/ModuleName/view/adminhtml/ui_component but didn´t work.


texts: Magento 2 : Mass Product add review and ratings using script

texts:
In my magento, there are appox. 10K product available. I want to add reviews and ratings in all products.

If I do this from admin, It will take lots of time.

I want to add this via script or programmatically.

Can anyone please help me how to do this?

Thanks.


texts:
Please how do I resolve this bug
"Exception #0 (LogicException): Could not create an acl object: Invalid Document
Element 'resource': The attribute 'title' is required but missing.
Line: 12"


texts:
Lately, I've been having issues getting exact shipping values as we don't have consistent packing to calculate into our shipping cost.

As such I'm going to increase the total order weight by 30% prior to the shipping getting calculated.

Unfortunately I really can't find a good spot to put this calculation in, I've tried a few different files along the way and they don't seem to cover both the shipping quotation at cart stage and the final shipping cost.

Could someone possibly point me in the direction of where i could put the calculation in to globally increase order weight prior to any shipping prices being fetched.

Thanks


texts: How to update custom order attribute from order view in magento 2?

texts:
I want to update some custom order attributes from the admin order section.
I have successfully created order attributes.

I want to show these attributes in the admin order edit section. I can show these values too.
But I am unable to edit and process with the form.

Please have a look at the attached image. See Order Additional Data.
I want to show an edit section like billing and shipping addresses.


texts: problem installing magento 2 on the server

texts:
guys I installed magento 2 on the server, and after that I removed it because it was in a different version than the one I should install. And I removed it using the command rm -rf 'project'. However when I went to install again using the command:
"composer create-project --repository = https: //repo.magento.com/ magento / project-community-edition = 2.3.5-p2".
He returned an error called "killed"
Updating dependencies (including require-dev) Killed
What can I do to fix it?


texts: Removing items from quote depending on custom condition

texts:
I am trying to use sales_quote_item_collection_products_after_load to remove items from a quote depending on a custom condition.

public function filterQuote(Varien_Event_Observer $observer)
{
   /** @var Mage_Catalog_Model_Resource_Product_Collection $collection */
   $collection = $observer->getProductCollection();
   /** @var Mage_Sales_Model_Quote $quote */
   $quote = Mage::helper('checkout/cart')->getQuote();
   $items = $quote->getAllVisibleItems();
   foreach ($collection as $product) {
     $customQty = $product->getCustomQty();
     foreach ($items as $item) {
       // We need to get the id of the simple product and not the parent.
       $simpleProduct = Mage::getModel('catalog/product')->loadByAttribute('sku', $item->getSku());
       $qty = (int) $item->getQty();

       // Check so the quote item matches the product and
       // compare the custom attribute.
       if ($simpleProduct->getId() == $product->getId() &&
           $qty >= $customQty) {
         // Remove the item from the collection.
         $collection->removeItemByKey($product->getId());
         break;
       }
     }
   }
}

I thought the above should work, but perhaps I should use some other approach. Right now all items still seems to be left in the cart even if I use $collection->removeItemByKey($product->getId()); for all items.


texts: How to bulk add a new category to multiple products

texts: Is there a way to bulk add a new category to multiple products in Enterprise?


texts: Magento 2 backoffice - crash category page

texts:
I have never worked for the moment on a magento 2 project and I decided to do some testing on my side.

My configuration : Ubuntu 18.04 - Apache/2.4.29 - PHP 7.2.13 - Magento 2.3.0

I had no problem installing Magento.

I did a little tour on the bakoffice and I went directly to the Magento 2 migration tool.

And I started by migrating only the configuration:
bin/magento migrate:settings [-r|--reset] {}

Then I went back to the backoffice and realized that the category page was not showing, there is an error in the browser "ERR_TOO_MANY_REDIRECTS".
I do not know if the problem has always existed.

I deleted all the cache of magento & the logs magento & logs apache.
I activated the developer mode : bin/magento deploy:mode:set developer
And I reloaded the category page.

The only log generated is debug.log of magento :

[2018-12-21 13:22:43] main.DEBUG: cache_invalidate:  {"method":"GET","url":"http://test.fr/admin_769ieh/catalog/category/index/key/6ecb4c1e1d0cd32447389cc81fd12fe6432ed6f807dc2941f5ddcee76c6b4295/","invalidateInfo":{"tags":["interception","CONFIG"],"mode":"matchingTag"}} []

This is the only page of the backoffice that crashes ...

I do not know where to look for someone can help me :-)

Thanks in advance


texts: Magento 2.2.10 + Porto Theme after install theme, HTTP ERROR 500

texts:
[16-Jun-2020 01:01:12 UTC] PHP Fatal error:  Uncaught Error: Call to a member function addCategoryFilter() on null in /home/vip/public_html/app/code/Smartwave/Filterproducts/Block/Home/LatestList.php:57
Stack trace:
#0 /home/vip/public_html/generated/code/Smartwave/Filterproducts/Block/Home/LatestList/Interceptor.php(24): Smartwave\Filterproducts\Block\Home\LatestList->getProducts()
#1 /home/vip/public_html/app/code/Smartwave/Filterproducts/Block/Home/LatestList.php(33): Smartwave\Filterproducts\Block\Home\LatestList\Interceptor->getProducts()
#2 /home/vip/public_html/vendor/magento/module-catalog/Block/Product/ListProduct.php(187): Smartwave\Filterproducts\Block\Home\LatestList->_getProductCollection()
#3 /home/vip/public_html/vendor/magento/framework/View/Element/AbstractBlock.php(666): Magento\Catalog\Block\Product\ListProduct->_beforeToHtml()
#4 /home/vip/public_html/generated/code/Smartwave/Filterproducts/Block/Home/LatestList/Interceptor.php(908): Magento\Framework\View\Element\AbstractBlock->toHtml()
#5 /home/vip/public_html/vendor/magento/module in /home/vip/public_html/app/code/Smartwave/Filterproducts/Block/Home/LatestList.php on line 57


texts: How to reset the category ID's count # for Magento 2.x?

texts:
I'm using a 3rd party plugin to setup our production website in a test/dev environment.

It allows export/import of the categories, excluding the Category ID's (which are automatically generated).

As a test, we created a full list of categories and a single product. Exported both, wiped both the product and categories, and the import works.

Except that the Category ID's are being added incrementally (instead of being "reset" when I delete the categories).

This makes sense from a Db perspective, so I'm assuming that the Category ID # is being incrementally counted from some Db count location.

Does anybody know where this count is coming from, and where I can reset it in Magento 2.1 ?  (this is just for testing purposes).

Thanks in advance.


texts: magento 2 - How to rearrange column of product grid?

texts: How to rearrange column of product grid ?


texts: Setting the weight unit which gets automatically generated

texts:
I am facing this issue since very long now, we have a delivery partner Ecomm express and one of our developers had integrated its API and now he's not working with us anymore.

So what is happening is whenever we book a pick up using the API it automatically takes 1 kg per unit as weight and hence at the end of the month we get charged for 1kg/unit.

We tried contacting the delivery partners to solve this issue and they said there is no issue with their API, they told me to find a file called GSM in magneto where there is a field called "actual_weight" and change it to 250 grams. But I don't where can I find this file, they also told me to take a Magneto developers help, so if anyone knows the solution please let me know.

I need to fix this issue urgently. Thanks.


texts:
I have issues understanding how my tax is calculated here:

As you can see I have a tax rate of 20%.

But then from a product of £50 the excluding tax price is £41.67.

It is like magento calculates a 16.66% tax rate.

Any ideas? Thanks!


texts: "sku" in checkout config provider. magento 2

texts:
I have something like this in my custom js file to fill an array of items with checkout config provider.

window.checkoutConfig.totalsData.items.forEach(function(item,index,array){
                products[index] = item;
                console.log(index);
                });

but apparently this does not contain the "sku" in the product details. How could I get this value?


texts: How similar are 1.9.1 with 1.9.4? would it be possible to copy and override folders from 1.9.1 to 1.9.4?

texts:
We have a slightly older version of Magento (1.9.1) that is a live production site for us. We have built a newer version (1.9.4) and it's all ready to go except this one issue I need to resolve first:

We need the gift card message to appear right away so that customers don't have to click like 3 clicks to get to the form field to fill in the gift card message (for us all customers will be filling out the gift card message on every order so it only makes sense).

I have posted a couple of posts previously with this topic but the solutions provided was not that straight forward so I had someone in the real world actually help me with this. Now I can't remember how it was done and who helped me (it was back in 2015). I tried to follow some of the suggestions on how to do that but with no success!

Now I wonder if it would be possible to just copy and override all folders and files that are responsible for how the gift card message field appears? I would be copying this from Magento 1.9.1 to Magento 1.9.4. Is this possible and which folders/files would you suggest I try to copy over?


texts: How to remake js code on jquery ui widget

texts:
I have a simple code that animates the appearance of a mini-cart modal window.

<script type="text/javascript">
    require(['jquery'], function($){
        $(document).ready(function(){
            $("[data-block='minicart']").on("dropdowndialogopen", (e) => {
                $(".block-minicart").hide();
                $(".block-minicart").slideDown(100);
            });
            $("[data-block='minicart']").on("dropdowndialogclose", (e) => {
                $(".mage-dropdown-dialog").show();
                $('.block-minicart').slideUp(100);
            });
        });
    });
</script>

I need to redo it in UI widget and call in phtml as <script type="text/javascript">code.
Tell me please how to implement this correctly?

I rewrite template in my theme:
vendor/magento/module-checkout/view/frontend/templates/cart/minicart.phtml

app/design/frontend/Vemdor/theme/Magento_Checkout/templates/cart/minicart.phtml

I'm creating: app/design/frontend/Vemdor/theme/Magento_Checkout/web/requirejs-config.js

var config = {
    map: {
        '*': {
            toggler: 'Magento_Checkout/js/minicart-toggler'
        }
    }
};

and app/design/frontend/Vemdor/theme/Magento_Checkout/web/js/minicart-toggler.js

define([
    'jquery',
], function ($) {
    'use strict';
    $.widget('vendor.toggler', {
        dropdownCartOpen: function () {
            $("[data-block='minicart']").on("dropdowndialogopen", (e) => {
                $(".block-minicart").hide();
                $(".block-minicart").slideDown(100);
            });
        },

        dropdownCartClose: function () {
            $("[data-block='minicart']").on("dropdowndialogclose", (e) => {
                $(".mage-dropdown-dialog").show();
                $('.block-minicart').slideUp("slow");
            });
        },
    });

    return $.vendor.toggler;
});

Please help finish the code


texts: Why are some Zend classes in the core codepool?

texts:
In app/code/core there is a folder Zend that contains several classes that are slightly different from the ones in Zend.
I understand the fact that based on how the Magento autoloader works, these classes will be used instead of the zend ones.
My question is to why are these needed.
I tried to compare the contents but it's too abstract for me.

Zend_Mime has been there since the beginning. It suffered a few modifications but it's there today.
Zend_Date was added in magento-1.7 and it has an explanation:

  This class replaces default Zend_Date because of problem described in Jira ticket MAGE-4872
  The only difference between current class and original one is overwritten implementation of mktime method

Well...there are other differences beside mktime. Any chance someone knows what the  MAGE-4872 jira ticket contains?

Zend_XmlRpc_Request and Zend_XmlRpc_Response were added in magento-1.7. I assume they were added because of this security issue, but that should be fixed by now.

Zend_Db_Statement was added in magento-1.8. For this one there are only 2 crazy regex-es in the  _stripQuoted method that I don't understand.

In older versions up to 1.3 there was some backend cache classes but I don't care about them anymore.


texts:
In magento 2 what is "form_code" for customer address attribute to show on checkout step?

I know in magento 2 form_codes are used to show customer address attributes on the customer registration, address book, manage customer address from admin and checkout step.

For customer registration we use form_code "customer_register_address", for address book we use form_code "customer_address_edit", for manage customer address from admin we use form_code "adminhtml_customer_address".

But I did not found any form_code code used to show customer address attribute on checkout step. What is "form_code" for customer address attribute to show on checkout step?


texts:
I have module settings when I specify disabled then the module page should return a 404 code
In the code, I get the value of the module but do not return 404 if the module is disabled
    <?php

namespace Mage\Faq\Helper;

use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Framework\ObjectManagerInterface;
use Magento\Framework\App\Helper\Context;
use Magento\Store\Model\ScopeInterface;

class Data extends AbstractHelper
{
    protected $storeManager;
    protected $objectManager;

    const XML_PATH_FAQ = 'faq/group_id/field_id';
    /**
     * @var \Magento\Framework\App\Response\Http
     */
    private $_response;
    /**
     * @var \Magento\Framework\UrlFactory
     */
    private $_urlFactory;

    public function __construct(Context $context,
                                ObjectManagerInterface $objectManager,
                                StoreManagerInterface $storeManager,
                                \Magento\Framework\Event\ManagerInterface $eventManager,
                                \Magento\Framework\App\Response\Http $response,
                                \Magento\Framework\UrlFactory $urlFactory,
                                \Magento\Framework\App\Http\Context $context,
                                \Magento\Framework\App\ActionFlag $actionFlag

    ) {
            $this->_response = $response;
        $this->_urlFactory = $urlFactory;
        $this->_context = $context;
        $this->_actionFlag = $actionFlag;
        $this->objectManager = $objectManager;
        $this->storeManager  = $storeManager;
        parent::__construct($context);
    }

    public function isEnable()
    {
        return $this->scopeConfig->getValue('faq/group_id/field_id', ScopeInterface::SCOPE_STORE);
    }

}


texts: Is that possible to get customer attribute in custom grid?

texts:
Here i m create one customer attribute.

Using custom module i want to change customer attribute.

Now i want that customer attribute column in my custom grid

in my custom table i m saving customer id.

So is it possible?

I want this attribute in my custom module grid


texts: How to show message in checkout shipping information page from plugin before save shipping address in magento 2

texts: I need to show a message in shipping information page before save the details from a plugin. how it is possible?


texts:
I'm having some trouble mapping a SQL query to the "Varien syntax".

So, I have a table where two of the columns are 'week' and 'year'.
Now I want to grab a collection of data from that table where I want to go from the "current week number" (pre-calculated) in the current year (2015) AND from week 1 to week 52 on 2016.

For now, I have this query:

$deliveryDeviations = Mage::getModel('godtlevert/delivery_deviation')->getCollection()
           ->AddFieldToSelect('*')
           ->AddFieldToFilter('billing_agreement_id', array('eq' => $billingAgreement->getId()))
           ->AddFieldToFilter(
                array(
                    array('week', array('in' => $totalWeeks)),
                    array('year', array('eq' => $year))
                )
            )
            ->AddFieldToFilter(
                array(
                    array('week', array('from' => '1', 'to' => '52')),
                    array('year', array('eq' => '2016'))
                )
            )

But this doesn't seem to be working as expected since it's placing ORs and I want the following:

WHERE (week IN (35,36,...) AND year = 2015)
OR (week IN (1,2,...,52) AND year = 2016)

Where am I going wrong?


texts: Checkout keeps redirecting to shoppingcart

texts:
Using Magento 1.9.1.
After reaching the final step in Checkout, it loops/redirects back to the shopping cart.
The articles in the shopping cart are not removed.
I have been searching for days, and tried every possible solution I could find, like:

1) Increased Cookie Lifetime

2) Redirect to CMS-page if cookies are disabled = No

3) web/url/redirect_to_base to 0 instead of 1

4) Clear var/cache and var/sessions folders

5) Disabled and changed shipping and payment methods

and so on...

I hope someone can help.


texts: URL was already generated for an item with SKU. ERROR

texts:
I have problem when trying to import products via CSV i get this error:

Url key: '******' was already generated for an item with the SKU:'*******'. You need to specify the unique URL key manually en filas: 2, 3, 5

the problem is that i have 170 rows of this, is there any chance that when magento recognize this error add "-(number)" after to product url key?


texts: How to Get MRP, Product Order Quantity, Address line1, Address line 2 in Order Success page Magento 2

texts:
I need to get

Address Line 1
Address Line 2
Each Product Order Quantity
MRP(Manufacturer's Suggested Retail Price)

code inside

  vendor/magento/module-checkout/view/frontend/templates/success.phtml

<?php
$lid = $this->getOrderId();
echo  "Order ID:".$lid."
";

$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$order = $objectManager->create('Magento\Sales\Model\Order')->load($lid);

$totall = $order->getGrandTotal();
echo "Order Total:".$totall."
";

$shippingAddress = $order->getShippingAddress();

echo "Telephone No:".$shippingAddress->getTelephone()."
";

echo "postcode".$shippingAddress->getPostcode()."
";

echo "city".$shippingAddress->getCity()."
";

$items = $order->getAllItems();

foreach($items as $i):
   $_productsku =
$objectManager->create('Magento\Catalog\Model\Product')->load($i->getProductId())->getSku();
   $_productquantity =
$objectManager->create('Magento\Catalog\Model\Product')->load($i->getProductId())->getQtyOrdered();
   $_productprice =
$objectManager->create('Magento\Catalog\Model\Product')->load($i->getProductId())->getPrice();

echo "product sku:".$_productsku."
";
echo "product quantity:".$_productname."
";
echo "product Rate:".$_productprice."
";
endforeach;
?>


texts: How can we get current product price in observer.php

texts:
i want set some discount on price with observer

class Brain_Priceedit_Model_Observer {

    public function _construct()
      {
      }

    public function getNewPrice()
      {
        //Your new functionality here
        //
        $newprice = '10';

        return $newprice;
      }

     public function updatePrice( Varien_Event_Observer $observer )
     {
        $event = $observer->getEvent();
        $quote_item = $event->getQuoteItem();
        $new_price = $this->getNewPrice();
        $quote_item->setOriginalCustomPrice($new_price);
        $quote_item->save();
      }
 }

i want to give 10% discount on current price


texts:
have in local a Clone of my site online, have update with composer from 2.2.8 to 2.3.2, have reproduced all steps from Magento 2 Guide
https://devdocs.magento.com/guides/v2.3/comp-mgr/cli/cli-upgrade.html

only after have execute the command php bin/magento setup:upgrade
show me this Error:

Notice: Undefined index: ves_blog_post in var/www/html/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php online 152 .....

anyone have idea/suggestions how to solve this problem?
Thank anyway


texts: Magento ORM not preventing concurrent db writes

texts:
The magento ORM layer doesn`t seem to handle concurrent saving of the same object gracefully. When saving a model the ORM issues an update sql query that just tests for the primary key.

Lets say you updated the customer_lastname of an order and save it to the database. The ORM layer will issue a query like this:

UPDATE sales_flat_order SET customer_lastname=`Test` WHERE entity_id=3

If another process (e.g. the paypal ipn controller) changed the same order at the same time (e.g. mark the order as payed), its changes might be overwritten.

This seems to me like a major flaw in the design of the ORM. Is there a reason the ORM layer doesn`t test for changes in the database upon saving?

The ORM layer might issue a query like:

UPDATE sales_flat_order SET customer_lastname=`Test` WHERE entity_id=3
       AND state='pending' AND status='pending' …

If the number of altered rows returned by the db is 1 it is certain that the database had not changed since the model was loaded. If the number of altered rows is 0 then the database was changed by another process after the model was loaded and the new changes were not saved and the save method should fail.

Is there a reason Magento doesn`t already do that (perhaps performance)?

Update

When creating a shipment in magento this happens (not only when creating a shipment, but this mechanism can be found throughout the codebase):

Load the order from the database using SELECT into model object
Create shipment model object from order

Loads all order items in model objects
gets QtyToShip from item model object (qty_ordered - qty_shipped - qty_refunded - qty_canceled)
updates qty_shipped in order_item model object

Save in DB

START TRANSACTION
save shipment model object in db
save order model object in db
save order_item model objects in db
COMMIT

When two processes try to create a shipment for the same order at the same time and process B is able to finish step 3 outlined above while process A is in step 2 then once process A finishes step 3 the changes made to the order_items by process B are overwritten.


texts: Add product to cart then auto redirect to checkout page

texts: I need some change in website. When product add to cart then page auto redirect to checkout page . Magento default option show only for auto redirect cart page but I need redirect to checkout page


texts:
We have a new overseas developer and we thought it would be better to take the safe side when giving access to the Dashboard, we created a separate account but need to limit access.
I attached an image for the Roles available and would appreciate to tell me which ones to restrict. The developer will apply security patches, updates, customization... But still we believe that giving full access would be risky.
I appreciate your help, image attached.


texts: How to indicate that order was fully paid(invoiced) or refunded?

texts:
I know one way:

base_grand_total = base_total_invoiced
base_grand_total = base_total_refunded

but I have that stupid rounding issues and this way is not convenient. Maybe you know something else? Compare qtys?


texts:
When We set mode default to a developer, files are removed from pub folder.

Magento 2.x
PHP 7.x


texts: How to change order status of Pending to Payment Review on homologation environment?

texts:
Hi i'm new at magento 2 and i want to change an order status of Pending to Payment Received, but i'm in homologation environment using sample data to test my store, so I still don't have a functional payment method.

Maybe the answer could be on this place that says "Automatically Invoice All Items option becomes available in the configuration". But which "configuration" ? where ?

Link where i got the image.
https://docs.magento.com/user-guide/sales/order-status-custom.html


texts: Grunt theme source files missing when running Grunt exec

texts:
I have a theme that extends the Luma theme. I am trying to get Grunt working to do preprocessing. So far, I don't have any changes/additions in my theme at all. I setup my themes.js as follows:

module.exports = {
   ...
    training_test: {
        area: 'frontend',
        name: 'Training/test',
        locale: 'en_US',
        files: [
            'css/styles-m',
            'css/styles-l'
        ],
        dsl: 'less'
    }
};

I do not have any root source files, but the documentation states that if you do not have any, use those from the parent theme.

When I run grunt exec:training_test I get the following error message:

Processed Area: frontend, Locale: en_US, Theme: Training/test, File type: less.
>> [InvalidArgumentException]
>>   Verify entered values of the argument and options. Unable to resolve the source file for 'frontend/Training/test/en_US/css/styles-m.less'
>>

I setup Grunt using a build script (on Ubuntu, hence the symlink):

sudo apt-get -y install nodejs
sudo apt-get -y install npm
sudo npm install -g grunt-cli
sudo ln -s /usr/bin/nodejs /usr/bin/node
cd /var/www/html/public; npm install

I then ran the magento deploy task (not sure if this is required or not):

bin/magento dev:source-theme:deploy

I noticed that the Luma theme also does not extend the source files in question (css/styles-m, css/styles-l):

luma: {
    area: 'frontend',
    name: 'Magento/luma',
    locale: 'en_US',
    files: [
        'css/styles-m',
        'css/styles-l'
    ],
    dsl: 'less'
},

Could it be an issue of multiple theme inheritance?


texts: Magento 2: How to observe default shipping address telephone change?

texts: Is there a way to observe if there is a change in telephone for default shipping address ?


texts: Add Tracking Script at a successful Order

texts:
i have a Tracking script and i can't really fill out every detail as it needed.

This is how far i get, but i can't really programm PHP or know the full Magento Documentation to find what i need.

<?php
$order = Mage::getModel('sales/order')->load(Mage::getSingleton('checkout/session')->getLastOrderId());
$items = $order->getAllItems();
$currency = Mage::app()->getStore()->getCurrentCurrencyCode();?>

Here a description of the Vales and it's meaning:

pg_pangora: merchant_id is mine id at the provider(i can fill that out ;) )
pg_order_id: the OrderId, i think i will fill that out with that script.
pg_cart_size: The amount of all bought Articles.
pg_cart_value: The end Price without Taxes. A decimal separator must be a point.
pg_currency: Is the ISO 4217 Value of the currency. In my case it will be EUR.
pg_customer_flag: new or old for a new Customer or a Customer which already bought something bevor.
pg_product_id:The Single Product ID or a comma separated list of the ID's of the bought Products. Example: '2342,4534,432'
pg_product_name: A Single Product name or a comma separated list of the names of the Products. Example: 'product1,product2,product4'
pg_product_price: A Single product price a comma separated list of the prices of the products. Example '9.99,24.90,17.80'
pg_product_units: The amount of every product in the Order separated with comma. Example '3,1,1'

It would be very nice if someone could help me out.


texts: SSH "Could not open input file: bin/magento" Magento2

texts:
Yesterday I was working on my new Magento2 site and add new module after that I use SSH command and it was working perfectly but today morning I start working and start putty to run command but it's not working. if I run any command it's show me error that could not open input file : bin/magento.

First I run command  php bin/magento setup:upgrade then php bin/magento setup:static-content:deploy also I run command related cache , indexing but same error I get all the time.

can anyone tell me why is it happening ? and how to solve this error message?

I checked in magento root folder that there is bin folder and within bin folder there is magento file.


texts: Reverse the order of thumbnail images in media.phtml

texts:
Situation:

In my store when a product has more then one image, the (Product)page shows the images in a jQuery slideshow. The code for this slider is created from the thumbnails in media.phtml with the following snippet:

<?php if (count($this->getGalleryImages()) > 0): ?>

    <?php $i=0; foreach ($this->getGalleryImages() as $_image): ?>
        <?php
        if (($filterClass = $this->getGalleryFilterHelper()) && ($filterMethod = $this->getGalleryFilterMethod()) && !Mage::helper($filterClass)->$filterMethod($_product, $_image)):
            continue;
        endif;
        ?>

            <a class="thumb-link" rel="media" href="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(800); ?>" title="<?php echo $this->escapeHtml($_image->getLabel()) ?>" data-image-index="<?php echo $i; ?>">
                <img src="<?php echo $this->helper('catalog/image')->init($this->getProduct(), 'thumbnail', $_image->getFile())->resize(265); ?>"
                     width="265" height="265" alt="<?php echo $this->escapeHtml($_image->getLabel()) ?>" />

    <?php $i++; endforeach; ?>

<?php endif; ?>

Problem:

The thumbnails are presented in reverse order, resulting in the main image always being displayed last (and out of sight).

Question:

What would I need to change to reverse the order in the thumbnail generation so the "main" image gets displayed first?


texts: Promotion, add condition Postal Code range

texts: Is there a module to add a range of postal code among the conditions of a promotion? and not individual values like now?


texts: How to edit what a cron readiness check is looking for?

texts:
I keep getting the following error in my update.log file:
update-cron.ERROR: Cron readiness check failure! Found non-writable paths:  .

../app/design/frontend/Magento

However, every time i do a composer update, it wipes this folder.  Is there a way to modify what the Cron rediness check is looking for ? (ie: remove this specific folder).


texts:
I'm working on a Magento 2.2.3 B2B, with the Quick Order feature enabled, and I can't find a way to extend a method of the Magento\QuickOrder\Model\Cart model.

So far I tried the usual:
MyCompany/MyModule/etc/di.xml:

<preference for="Magento\QuickOrder\Model\Cart"
    type="MyCompany\MyModule\Model\Cart"/>

and then in MyCompany\MyModule\Model\Cart.php:

<?php
namespace MyCompany\MyModule\Model;

class Cart extends \Magento\QuickOrder\Model\Cart
{
    protected function _addAffectedItem($item, $code)
    {
        // My extended code
    }
}

But it's not working. I also tried using a plugin, but for some reason my code is being ignored. Any ideas of what's going on with this Model?

Thanks in advance


texts: How to show Country of Manufacture attribute in layered navigation?

texts:
I want to use Country of Manufacture attribute in layered navigation. I have set 'Use In Layered Navigation' Yes by editing the attribute from admin. but still it's not showing in layered navigation in frontend.

Can anyone help me on this issue?

Thanks in advance!


texts:
After migrating website from Magento 1 to Magento 2 Customers are imported but not showing up in customer grid. I added customer manually but the result is same. New customers show up on the dashboard but not in customers section.

I already reindex but no no luck.

I already did

update indexer_state set status = 'invalid' where status != 'valid'

Then run:

php -f bin/magento indexer:reindex


texts: Calculating the size of a box for multiple products for carrier module in Magento 2

texts:
Example: Suppose I have three products like a phone(2w,4h,3d), power bank(12w,15h,8d), screen guard(1.2w,1.8h,1d)

By using these three dimensions to make new Box dimensions. I have to fit these three products using the latest dimensions Box.

W: width, H: height, D:depth

I took the wrong dimensions for just an example to understand the purpose.


texts: First and Last Name Fields Not Showing - Billing Information

texts:
One of my client's requirements is that all purchases are made as 'guests' in order to simplify the checkout process.

So what I did was go to
System > Configuration > Advanced
and disabled the Mage_Customer

Everything looked like it was exactly what I needed until I tried the checkout process again. For some reason, the First Name and Last Name fields are no longer showing up and I cannot get past the Billing Information step.

How can I get these fields to show up again while still only allowing for guest purchases? Is it wrong to disable Mage_Customer?

Thanks!
Mike

p.s. I am on Magento ver. 1.9.2.2


texts: Magento 2 How to add custom attribute to customer address and how to insert value in that attribute?

texts:
I want to add a new custom attribute to "customer_address" that I did with an attribute installer script, now I am able to see that field in "eav_attribute" table. I have created a module and I have one observer for "custmer_save_after" in that. Now I want to set a custom value for that custom attribute which I created from the script.

how can I achieve this functionality?


texts: `copyFieldset` one source property to multiple target properties

texts:
I'm tasked converting quotes into a custom data type, and using Mage_Core_Helper_Data::copyFieldset was working really well until I had two target properties that had to be set to the same source property. I've tried a couple of different things

        <other_thing_convert_quote>
            <grand_total>
                <to_varien_object>total</to_varien_object>
            </grand_total>
            <quote_currency_code>
                <to_varien_object>currency</to_varien_object>
            </quote_currency_code>
            <quote_id>
                <to_varien_object>refnum</to_varien_object>
                <to_varien_object>txn_uuid</to_varien_object>
            </quote_id>
        </other_thing_convert_quote>

Above is one quote_id node, multiple to_varien_object nodes.

        <other_thing_convert_quote>
            <grand_total>
                <to_varien_object>total</to_varien_object>
            </grand_total>
            <quote_currency_code>
                <to_varien_object>currency</to_varien_object>
            </quote_currency_code>
            <quote_id>
                <to_varien_object>refnum</to_varien_object>
            </quote_id>
            <quote_id>
                <to_varien_object>uuid</to_varien_object>
            </quote_id>
        </other_thing_convert_quote>

Above is multiple quote_id nodes, each with one to_varien_object node.

Neither of these approaches successfully apply quote_id to both refnum and txn_uuid.

Looking at the code, I'm not sure if what I'm looking for is even possible, but hopefully I can be proven wrong!

Thanks


texts:
Hi I have a product in magento and it was deleted via api call.
When I try to check the product detail page, the page was not found. I try to put the -1 on the url key, eg: small-business-premium-1 the product detail page can be seen.


texts:
Currently I am using the code below to refund a full order and create the creditmemo..

        $order = Mage::getModel('sales/order')->loadByIncrementId('100091904');
        $invoices = array();
        foreach ($order->getInvoiceCollection() as $invoice) {
            if ($invoice->canRefund()) {
                $invoices[] = $invoice;
            }
        }

        $service = Mage::getModel('sales/service_order', $order);
        foreach ($invoices as $invoice) {
            $creditmemo = $service->prepareInvoiceCreditmemo($invoice);
            $creditmemo->refund();
        }

But the problem is that the customer paid online with SagePay, this current method ONLY refunds this offline and as you can see this could be a very big problem, anyone got any ways to get around this? Would be much appreciated. Using Magento Enterprise ver. 1.12.0.2

I've not found anything on this before this purely REFUNDING online, not creating the Credit Memo that is the problem it only refunds offline.


texts: How to import customers in magento-2 using csv?

texts: Currently i am working on magento-2 .I have imported products successfully. Now i want to be import customers . I dont have any demo csv for import customers .


texts: how to disable payment method even is active

texts:
I have a "Custom Shipping Method" and have 3 payment methods... Want to show one of these 3 payment methods if 1 of the fields in system.xml of "my custom shipping" is "1" and also my "custom shipping" is active and if "custom shipping" is not active, do not display it even the field is "1" in system.xml from backend and then only show 2 others

Is this possible? if yes, How can set it in my codes?

This is my observer but do not work

public function paymentMethodIsActive($observer)
    {
        $event  = $observer->getEvent();
        $method = $event->getMethodInstance();
        $result = $event->getResult();

        $activeCarrier = Mage::getStoreConfig('carriers/mycarrier/active');
        $activeCustom  = Mage::getStoreConfig('carriers/mycarrier/custom');

        if ($method->getCode()  == 'payment_method') {
            if ($activeCarrier == '1' && $activeCustom == '1') {
                $result->isAvailable = true;
            } else {
                $result->isAvailable = false;
            }
        }
    }


texts: adding product to the left-category-navigation in magento

texts:
Well, I am working on my first Magento website. I am using Magento 1.9.2 & lunxury theme 1.2.X

I am trying to add products in left navigation bar manually.

What I have done so far

In my app\design\frontend\mgstheme\luxury\template\mgs\mpanel\template\category-navigation.phtml File I put this code.

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

       <?php echo $_menu ?>

              <?php foreach ($products as $_product) { ?>

<?php echo $_product->getName(); ?>

                <?php } ?>

for now, its printing all products but I want all products under their category name.

I am attaching screenshot for reference here jemmy proof lock to cupboard are the categories and after that its loading all products


texts: Magento v. 2.1.4 Readiness Check Fails at Component Dependancy

texts:
No other information is given.
  (Or, if it is, I do not know where to look for it.)

I have a clean Magento install, no theme, no extensions, nothing.

I am on a shared server so direct php.ini edits are not available.
   (But, yes, I have adjusted memory limits through Cpanel as per articles found here and on github.)

I do have CLI access.

Running:
Magento 2.1.4, PHP 5.6, MySQL 5.6, Server OS Linux.

Any helpful ideas would be welcome. I am well and truly stuck. Thank you!


texts: Class mapping from Magento 1 to Magento 2

texts:
I am working on migrating an extension from Magento 1.9 to Magento 2.

I want to know about the class migration followed between Magento 1.x to Magento 2.

Can anyone please help me in tracing the class-mapping followed in Magento 2 from Magento 1?


texts: Magento 2 Checkout post code (zip code) is not a required filed

texts:
I want to make the postcode filed a required filed in the checkout process. I am sure that by default, this IS required but for some reason, it isn't in my store.

I know there is entry in vendor/magento/module-checkout/view/frontend/layout/checkout_index_index.xml that makes the filed required:

<item name="postcode" xsi:type="array">
     <!-- post-code field has custom UI component -->
     <item name="component" xsi:type="string">Magento_Ui/js/form/element/post-code</item>
     <item name="validation" xsi:type="array">
     <item name="required-entry" xsi:type="string">true</item></item>
</item>

But I can't see my theme overwriting this file anywhere but just to be sure I added the original file from vendor to my theme folder. Still no luck.

How else would I debug this issue?

Running on:

Magento 2.1.8
Custom theme "Venustheme/cricket"
Nginx


texts: Magento: How to Edit Footer Block Titles?

texts: I'm using a translation option, but "Quick Links" footer block title didn't translate. How can I edit this title?


texts:
I have added a new column to the newsletter_subscriber table, 'artists_followed'. in my overridden Mage_Newsletter_Model_Subscriber model class, I have added the following function:

public function updateSubscriberArtists($email, $artist) {
    $this->loadByEmail($email);
    if ($this->getId()) {
        $this->setArtistsFollowed($artist);

        try {
            $this->save();
        }
        catch (Exception $e) {
            throw new Exception($e->getMessage());
        }
    }
}

everything runs ok, no errors are thrown, but when I look in the database, the new column is not populated.

My table is:

CREATE TABLE `mage_newsletter_subscriber` (
  `subscriber_id` int(7) unsigned NOT NULL AUTO_INCREMENT,
  `store_id` smallint(5) unsigned DEFAULT '0',
  `change_status_at` datetime DEFAULT NULL,
  `customer_id` int(11) unsigned NOT NULL DEFAULT '0',
  `subscriber_email` varchar(150) CHARACTER SET latin1 COLLATE latin1_general_ci NOT NULL DEFAULT '',
  `subscriber_status` int(3) NOT NULL DEFAULT '0',
  `subscriber_confirm_code` varchar(32) DEFAULT 'NULL',
  `created_at` datetime DEFAULT NULL,
  `campaign_source` varchar(255) DEFAULT NULL,
  `artists_followed` text,
  PRIMARY KEY (`subscriber_id`),
  KEY `FK_SUBSCRIBER_CUSTOMER` (`customer_id`),
  KEY `FK_NEWSLETTER_SUBSCRIBER_STORE` (`store_id`),
  CONSTRAINT `FK_NEWSLETTER_SUBSCRIBER_STORE` FOREIGN KEY (`store_id`) REFERENCES `mage_core_store` (`store_id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Newsletter subscribers';

I'm racking my brain on this one. Any ideas? Am i missing something completely obvious?


texts: Magento 2 Admin Grid Filter lost on reload

texts:
I created a custom grid with custom entities in the admin section. Everything works as expected, even the filter.
If I add a filter and reload the filter, the filter is lost though. This doesn't happen in the product grid, what am I missing? How to keep the filter even after reload the grid?

This is the specific part of my ui_component for the grid:

<filters name="listing_filters">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="columnsProvider" xsi:type="string">lot_record_lot_list.lot_record_lot_list.raffiniert_datasheet_lot_columns</item>
            <item name="storageConfig" xsi:type="array">
                <item name="provider" xsi:type="string">lot_record_lot_list.lot_record_lot_list.listing_top.bookmarks</item>
                <item name="namespace" xsi:type="string">current.filters</item>
            </item>
            <item name="templates" xsi:type="array">
                <item name="filters" xsi:type="array">
                    <item name="select" xsi:type="array">
                        <item name="component" xsi:type="string">Magento_Ui/js/form/element/ui-select</item>
                        <item name="template" xsi:type="string">ui/grid/filters/elements/ui-select</item>
                    </item>
                </item>
            </item>
            <item name="childDefaults" xsi:type="array">
                <item name="provider" xsi:type="string">lot_record_lot_list.lot_record_lot_list.listing_top.listing_filters</item>
                <item name="imports" xsi:type="array">
                    <item name="visible" xsi:type="string">lot_record_lot_list.lot_record_lot_list.raffiniert_datasheet_lot_columns.${ $.index }:visible</item>
                </item>
            </item>
        </item>
        <item name="observers" xsi:type="array">
            <item name="column" xsi:type="string">column</item>
        </item>
    </argument>
</filters>

Is there anything else I need to add to keep the filter after reloading?


texts: How to update customer telephone if customer doesn't have in the billing address?

texts:
I want to update the customer telephone number if the customer doesn't have.
In our website we disabled the telephone mandatory in adding address field.
We recently implement a payment gateway that the telephone field is mandatory.
I want to update the customer telephone table if the customer doesn't have the telephone number in there shipping or billing address.
I tried this way.

Created a file update_phone.php in the root

require_once 'app/Mage.php';

$conn = mysql_connect("localhost","user","password");
$db   = mysql_select_db("dbname",$conn);

$sql = "SELECT ce.entity_id,ce.email, ea.attribute_code, cev.value
    FROM customer_entity AS ce
    LEFT JOIN eav_attribute AS ea ON ce.entity_type_id = ea.entity_type_id AND ea.backend_type = 'varchar'
    LEFT JOIN customer_entity_varchar AS cev ON ce.entity_id = cev.entity_id AND ea.attribute_id = cev.attribute_id
    WHERE attribute_code = 'mobile'
    ORDER BY entity_id DESC LIMIT 1";

//mobile is a custom attribute it will collect during registration

$result = mysql_query($sql);

while($row = mysql_fetch_assoc($result)){
    $customerId = $row['entity_id'];
    echo $customerId;//Upto this line code is working.
    $customer = Mage::getModel('customer/customer')
        ->load($customerId)->getData(); // insert customer ID
    //Mage::getModel('customer/customer')->load($id)->getData();

    foreach ($customer->getPrimaryBillingAddress() as $address)
    {
        $data = $address->toArray();
        var_dump($data);
    }
}

Up to echo $customerId; code is running.

My scope is get the mobile number and check the billing telephone number is available in the customer address with the customer id and if telephone number is not available want to update with mobile number.
please Help me in this task


texts: magento 2.3.5 any text field ask for login save password for new device with fingerprint or eye print and not allow to checkout. and I'm use sm market theme and mobile login from magecomp


texts: Autoload own and packagist classes in module

texts:
I'm creating a module, which uses a range of its own classes as well as packagist modules

Running on its own outside magento, my composer.json is:

{
    "name": "root/importer",
    "authors": [
        {
            "name": "jochendaum",
            "email": "jd@myemail"
        }
    ],
    "autoload": {
        "psr-4": {
            "Zenith\\": "classes"
        }
    },
    "require": {
        "nicolab/php-ftp-client": "^1.4",
        "league/csv": "^9.1"
    }
}

But when I transfer this into my module under directory

/app/code/Zenith/Importer

it doesn't work after running bin/magento setup:upgrade .Both my own classes and packagist classes are not found.


texts: Can't get thumbnail category - Magento 2.1.6

texts:
I checked quite many threads about this topic but was not able to solve the issue. When I open a category overview I don't get the thumbnails. Opening the product details I can see the main image and the smaller images in the slider below. So that shouldn't be any permission issues. Magento also generates the cache directory with 4 different image sizes.

My url to the thumbnail is:

pub/media/catalog/product/cache/f073062f50e48eb0f0998593e568d857/a/a/aaa_5_2_3.jpg

  find . -name "aaa_5_2_3.jpg"
  pub/media/catalog/product/cache/f9c7fbe9b524c081a3ccf800cbd963eb/a/a/aaa_5_2_3.jpg
  pub/media/catalog/product/cache/75eed2686e01eb22cb4050b2f40ddf97/a/a/aaa_5_2_3.jpg
  pub/media/catalog/product/cache/0f831c1845fc143d00d6d1ebc49f446a/a/a/aaa_5_2_3.jpg
  pub/media/catalog/product/cache/afad95d7734d2fa6d0a8ba78597182b7/a/a/aaa_5_2_3.jpg

I guess the identifier (=f073062f50e48eb0f0998593e568d857) is wrong. Where does it come from? I tried to find the php file where the path is generated but couldn't find it.

php bin/magento setup:static-content:deploy didn't help either. That's why I think the identifier is wrong.

I migrated the data from Magento 1.7.0.2 with the migration tool and copied the directory public/media/catalog to pub/media/catalog.

Maybe somebody can help me out, I'm quite new to magento.


texts: Magento 2 Custom options of some products are not visible

texts:
When I add a new product, I tried to import the customizable options from the previous one.

I have saved it after imported the data.

After adding all product, I try to test it on the front-end. Most of the product should work fine like this(pic 1):

However, without knowing the reason, an issue came out is that some of the product acting weird and missing the custom options like this, only with the attribute color:

Some of the product even look like this, without options to be chosen before adding to cart:

I checked the admin panel, those products have the data of the customizable options but do not know what is the problem that not showing it. How I solve this is I clicked the save button again, the problem gone and display normally like(pic 1).

I make a guess after some research, is that this kind of issue will happen on 2.1.x version?

I want to know the reason and how to solve it because the issue is happening again and again so I need to check the products on front-end every day now to ensure the products work fine. I have this issue like every day, the issue might not happen on the same product each day.


texts: magento 2.2 static content deploy errors

texts:
I am trying to deploy static content in developer mode in magento 2.2 community edition. I am getting multiple errors in terminal related to css.

Getting error as -

  [Magento\Framework\Exception\FileSystemException]
    Cannot read contents from file "/var/www/html/[site]/staging/pub/static/frontend/Magento/blank/en_US/Mysite_Theme/css/less/type.css" Warning!file_get_contents(/var/www/html/[Site]/staging/pub/static/frontend/Magento/blank/en_US/Mysite_Theme/css/less/type.css): failed to open stream: No such file or directory   .

I checked for the file type.css, there is no file present in the project with such name.

Please provide a solution.


texts: How to use magento ImportExport module in your custom module

texts:
For my module I need to insert data that has nothing to do with magento products or categories. It is just a list of stores, addresses and coordinates, so I guess it could be a separate table inside the db. I'm stuck and don't know how to start as there is little information about this.

I found this useful presentation http://netzarbeiter.com/media/MagentoImagine/ImportExport.pdf that talks about
Mage_ImportExport_Adminhtml_ImportController and Mage_ImportExport_Model_Import, but I need slightly more information about how to use it.

Basically, I think it should be something simple as this, but developed in an OOP magento way...

$file = $_FILES["file"]["tmp_name"];

$handle = fopen($file, "r");

while(($data = fgetcsv($handle, 1000, ",")) !== FALSE){

    $latitude = $data[0];
    $longitude = $data[1];

    $sql = mysqli_query($conn,"INSERT INTO table_name (latitude,longitude) VALUES ('".$latitude."','".$longitude."')");

}

I know it is a long shot, but maybe there is somebody here with experience at this and can provide directions...

Thanks!


texts: Upload buttons missing because of broken Flex uploader?

texts:
I know this has been discussed several times, but I could not find any information on my problem. I guess its due to patch 8788. This is an older 1.7.0.2 store and whenever I open a product to upload images the buttons are missing.

I get JavaScript errors so I checked the source using the dev tools in Chrome. In the srouce it looks like this:

 = new Flex.Uploader('id_866e99d3098a9212b06b94f068f22b75_Uploader', '', );

The source in uploader.phtml looks like this:

<?php echo $this->getJsObjectName() ?> = new Flex.Uploader('<?php echo $this->getHtmlId() ?>', '<?php echo $this->getUploaderUrl('media/uploader.swf') ?>', <?php echo $this->getConfigJson() ?>);

So as it seems $this->getJsObjectName() and the other similiar calls return nothing. Any ideas why and how to fix?

Thanks!


texts: Error occurs when I import csv in table rates tab

texts:
I want to set shipping charges according to me, when I imported a csv it throws error -

  The file "/tmp/opt/lampp/temp/phpdtjPun" doesn't exist

Can  anyone help me. I am new to magento 2.1.0


texts:
My store is multi domain and every domain has a different default currency:
 - .com -> USD
 - .eu -> EUR

The store has EE FPC enabled on Redis backend.

The issue:
Sometime product pages of the store .com get cached with a wrong currency. ( if I clean FPC then the page/currency it is ok )

Now FPC stores the key using the request and cookies ( so also the currency in case the user changed it) thus the key should be unique for every url/currency request.
Anyway It looks like in some cases, request to product page X on the Domain A  override the cached page for the Domain B.

I cannot figure out what is the reason because this is happening on random basis and It is hard to reproduce.

What can I check ? any idea to debug this is very welcome


texts: Product view does not inherit default head block xml (Magento 2 CE)

texts:
First off let me just say, I am green when it comes to Magento (all versions) and have been trying to figure this out for two days and I am not sure what else to try. I have been fiddling with a custom template that inherits the Luma theme and I have figured out how to muddle through the xml files for block placements and so forth, mostly getting things to work by trial and error. I changed the default_head_blocks.xml located in my custom theme here:

/app/design/frontend/myvendor/mytheme/Magento_Theme/layout/default_head_blocks.xml

to include a custom css file to override some of the Luma css (mine is labelled as css/mycss.css):

<head>
    <meta name="x_ua_compatible" content="IE=edge,chrome=1"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <css src="mage/calendar.css"/>
    <css src="css/mycss.css"/><!-- <<<--- I added this -->
    <script src="requirejs/require.js"/>
</head>

I was very happy with myself that something I did actually worked, until I went to look at the single product view (the category view inherits the css just fine and I also have the category set to apply my template to in-category products...something else I tried, not sure if that is right or not). I checked to make sure the product itself was also using my template under the Design tab in the admin area, which it says it is. Then I went to the catalog folder to try and mess around with all of the xml documents pertaining to product such as the catalog_product_view.xml, catalog_product_view_type_simple.xml, etc... and adding:

<head>
    <css src="css/mycss.css"/>
</head>

I should mention I did move all combinations of these xml files into both:

/app/design/frontend/myvendor/mytheme/Magento_Catalog/layout/

and/or

/app/design/frontend/myvendor/mytheme/Magento_Theme/layout/

Last thing to mention, I flush my cache every time I change something.

Anyway, I have Googled the crap out of this and I tried to adapt some Magento 1.x answers to try and solve it, but I can not figure it out with my limited Magento knowledge. Any push in the right direction would be helpful at this point because I am just staring at my Magento project folder right now with a dumb perplexed look on my face...

EDIT

After more "trial and error" I have deduced that this page, including the account signup, login, etc. are just using the base template...how do I know? I did the unthinkable! Just to test, I added my <css src="css/mycss.css"/> to the base theme's default_head_blocks.xml file located here:

/vendors/magento/theme-frontend-blank/Magento_Theme/layout/default_head_blocks.xml

So I guess my question is, how come it's using the base template (which I already suspected it was doing) and not the one I am assigning it? I am missing something, but I don't know what it is or where to fix it.


texts: Magento 2: Move add to cart in Your Customisation (bundle product page) before Go back to product details

texts:
I want to customize the bundle product page on the magento2 store.
How to move the "add to cart" button to before "Go back before link", Also I want to validate fixed quantity too. So I can hide the "Customize and Add to Cart" button.
Any help will be appreciated. Thanks


texts:
I have this script which gets all bundle products

$View = 2;

$products = Mage::getModel('catalog/product')
                ->setStoreId($View)
                ->getCollection()
                ->addAttributeToSelect('*')
                ->addAttributeToSelect('type')
                ->addFieldToFilter('type_id', array('eq' => 'bundle'))
                ;

Then I do this to cycle them and I try to get Store View Title (which is title)

foreach($products as $bundle)
{
        $productId = $bundle->getId();

        $bundled_product = new Mage_Catalog_Model_Product();
        $bundled_product->load($productId);

        $typeInstance = $bundled_product->getTypeInstance(true);

        $selectionCollection = $typeInstance->getSelectionsCollection(
            $typeInstance->getOptionsIds($bundled_product), $bundled_product
        );

        $optionCollection = $typeInstance->getOptionsCollection($bundled_product);

        $_options = $optionCollection->appendSelections($selectionCollection, false, Mage::helper('catalog/product')->getSkipSaleableCheck());

        $bundle_option = array();

        foreach ($_options as $key => $value)
        {
            echo $value->getData('title'); //Doesn't work, print nothing
            echo $value->getData('default_title'); //It Works
        }
}

However, despite I set the store_id to be what I want, it seems like it still takes the default view.

How can I print the Store View Title then?


texts: Cart Price Rules: More than two discount at the same time

texts:
I have a requirement to apply two discount at the same time on my shopping cart value.. there is any way to do this currently only one shopping cart rule is applied at a time.

please give me a solution for that...thank you.


texts:
My website saree.com is built on magento. Follow this steps and you will notice the issue.
1. Login to account
2. Add product to cart
3. Logout
4. Change Currency
5. Login to account
6. Check product in cart.

Only currency gets changed but price remains the same. Any clue ?

TIA.


texts: Re-adding products to cart on payment failure requires refresh

texts:
I referred this url (Prevent Magento to empty cart after failed payments) and came up with the following code to add the products back again to the cart.

public function failureAction()
{
    $lastQuoteId = $this->getOnepage()->getCheckout()->getLastQuoteId();
    $lastOrderId = $this->getOnepage()->getCheckout()->getLastOrderId();

    if ($lastQuoteId && $lastOrderId) {
        $orderModel = Mage::getModel('sales/order')->load($lastOrderId);
        $quote = Mage::getModel('sales/quote')->load($lastQuoteId);
        $quote->setIsActive(true)->save();
    }
    if (!$lastQuoteId || !$lastOrderId) {
        $this->_redirect('checkout/cart', array("_forced_secure" => true));
        return;
    }

    $this->loadLayout();
    $this->renderLayout();
}

I'm displaying a page on the failureAction which the 3rd party payment gateway redirects. The problem is that when the payment gateway redirects and the page is shown for the first time, the cart is displayed as empty. When i refresh the page the products get added to the cart. How can i achieve this without refreshing the page?


texts: Using API to get child skus from configured composite sku

texts: I'm using the Magento API to get SKUs from an order. We have a set of "configured" items that allow selecting optional add-on products but the order API returns these items as what seems to be called a "composite" SKU which looks like: "ITEM-BASE-SKU-OPTIONAL-SKU-ONE-OPTIONAL-SKU-TWO". How do I get the "children" of a sku that looks like this? All I need is to reliably get the child strings; the lookup can be a separate call.


texts: Which index to refresh after adding a new product

texts:
To win some time on product changes i have set some indexes to manual.

Only "Product Prices" and "Stock Status" are set to "Update on save", all others are manual. A cron is sceduled to re-run indexes at an appropriate non-production hour (5am)

But which of the folowing indexes must be refreshed when adding a new product?

Product attribute
Product flat data
Category flat data
Categort Products
Catalog search index
Label Aggregatie Data
Catalog Url rewrite

When doing all it takes up to 1-2 hours ....

We use magento 1.8.1 CE


texts: Magento Database column have value or not

texts:
I newly created one field in existing table and store that table. It's working fine. But i want to check that field have a value or not.

Field id ="deliverytime"

<?php if($seller->getdeliverytime() > 1){?>

 Usually Delivered in  <?php echo $seller->getdeliverytime() ?>  business days.

<?php }
else
echo "No";?>

How to i check ??


texts: Filter in Admin Panel by MSI Salable Quantity > 0

texts: How can I add a filter in the Admin Panel products grid to filter (display only) product with Salable Quantity > 0?


texts: product attribute to quote item and order item

texts:
What is the correct way in Magento to have a product attribute be automatically persisted to quote an item and then finally to order item?

Is it as simple as a little config XML or is it a manual process looking at before saving events and so forth?