texts: Magento same product in cart with different prices

texts:
I have 5 items in cart with same product id.

I want to set first 4 item price as 9.99 and 5th item onwards will have of 20% discount on original price.

I have set first 4 items as club_item and 5th product onwards as other product(using my custom table).

If I add only 4 items, then all the 4 product's price is showing correctly as 9.99;

But when I add all 5 items, then all the 5 items price is changing and it is the price of last item added. Means all items are showing price = (actual_productprice - 20% discount).

How can I show different price for only 5th Item.

I have below event

    <events>
           <sales_quote_add_item>
               <observers>
                  <Company_Module_Model_Observer>
                     <type>singleton</type>
                     <class>Company_Module_Model_Observer</class>
                     <method>updatePrice</method>
                  </Company_Module_Model_Observer>
              </observers>
           </sales_quote_add_item>
    </events>

And my observer function is :-

    public function updatePrice($observer)
    {
        $event = $observer->getEvent();
        $product = $event->getProduct();
        $quote_item = $event->getQuoteItem();

        $productId = $quote_item->getProductId();

        if(Mage::getSingleton('customer/session')->isLoggedIn()) {
             $customerData = Mage::getSingleton('customer/session')->getCustomer();
              $customer_id = $customerData->getId();
        }

        $_customModel = Mage::getModel('custom/custom')->getCollection()
                ->addFieldToFilter('product_id', array('eq'=>$productId))
                ->addFieldToFilter('customer_id', array('eq'=>$customer_id));

        $_customData = $_customModel->getData();

        $actualPrice = $quote_item->getProduct()->getFinalPrice();

        /* this is for separating each line item in cart */
        $quote_item->addOption(array(
              "code" => "random",
              "value" => serialize(array(time()))
        ));

        $new_price = 0;
        foreach ($_customData as $_customDataValue) {
            $_isClubProductId   = $_customDataValue['product_id'];
            $_isClubItem        = $_customDataValue['is_club_item'];

            /* Here I am differentiting the products with variable $_isClubItem */

            if($productId == $_isClubProductId && $_isClubItem == 1){
                $customPrice = 9.99;
                $new_price = round($customPrice, 4);
            }else{
                $new_price = (float)number_format($actualPrice * ((100-20) / 100),2);
            }
        }

        $quote_item->setOriginalCustomPrice($new_price);

        //$quote_item->save();
        $quote_item->getQuote()->save();
    }


texts: Miss-match discount price with 2 catalog price rule magento 1.9

texts:
I have facing issues with catalog price rule. You can see below senario which you getting to help you.

I have a product which have price $77.00, sku - product1

I create two Catalog Price Rule for both are NOT LOGGED IN Group

Rule 1:

priority - 1

sku - product1

Apply - by percent

discount amount - 54%

Stop Further Rules Processing - yes

After applying discount and getting price on Product detail page is 35.42

Rule 2:

priority - 2

sku - sproduct1

Apply - by percent

discount amount - 40%

Stop Further Rules Processing - yes

After applying discount and getting price on Product detail page is 46.20

But when these both are active product price is 35.00. Don't getting what happening? It should show 35.42

can you please improve answer.
Thanks


texts: How to use Magento HTTP\Client\Curl with HTTPS Url

texts:
How can I do a curl get request if the URL is in SSL? I get an error of malform url or 419. But I used a valid url. I'm thinking is probably the URL is in HTTPS? Although I'm not sure. So I was thinking of adding a header parameter in the client/curl in magento. But I have no idea on how to achieve this. Right now I only have this

try{
        $this->_curl->get($file, []);
        $this->_curl->setOption(CURLOPT_RETURNTRANSFER, true);
        $response = $this->_curl->getBody();
        // $this->_logger->debug($response, []);
        return $response;

    } catch(\Exception $e) {
        $this->_logger->critical('Error Curl', ['exception' => $e]);
    }


texts: allowing product with custom options as bundled item

texts:
when i am trying to add product as bundled items it does not shows product with custom option , how can i solve this issue

below is my case

1: i have different products attribute sets : ring, pendant ,earrings
2: ring can be in multiple size : 5,6,7,8,9,10,11,12 with same price for all
3: so i thought of using custom drop down option in add products
4: now same product does not appears while adding bundled items.

ways to solve it

1: can i do something so product with custom options can also be shown while adding bundled items
2: is there way to add drop down attributes to products other that configurable and custom option that will also be supported by bundled items


texts: Magento2: How to bulk update attribute: weight

texts:
I will try update in bulk for all products attribute: weight

But When I select all products and then click on update attributes I dont see weight field.

Any solution?


texts: Downside of using Mage::getModel and load/getCollection in a template file

texts:
What would be the downside of using Mage::getModel (+ load, getCollection) in a template?

I've seen quite a few templates with this logic put directly in the template instead of using the block?


texts: "No callbacks found" error message in magento 2 cron job

texts:
I have created a crontab in my custom module and scheduled at every 10 minutes.
It is working fine, when I am running the "php bin/magento setup:upgrade" command.

So, first time it is working fine, in cron_schedule table, status = success and message = null. which is fine. but, after 10 minutes this cron is not working.

Having status = error and message = "No callbacks found".
I have debugged the code and found that in second time cron "instance" is not being set.

Can anyone help me on this? Why there is no instance in second time?

Thank you.

Here is my crontab.xml code:

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="index">
    <job name="cron_setup_job" instance="Vendor\Module\Cron\ClassName" method="execute">
        <schedule>*/10 * * * *</schedule>
    </job>
</group>
</config>


texts:
In my report_sales > coupons page I get exception
Base table or view not found: 1146 Table salesrule_coupon_aggregated doesn't exist
And I find out that system didn't create this table (It doesn't exist in my database).
What is the right way to create this table. Re run setup/upgrade or I need delete whitelist and than re-generate it?


texts: Magento 2 credit memo does not return Item to stock

texts:
My requirement was qty decrease by invoice generation instead order & it's also working fine So, for that I have did some configuration on magento back end, (I have attached screenshot for that).

When I have generate credit memo of that order after that quantity does't return back to on that product inventory.

Can anyone know why this happening.

Help will be appreciated.

Thanks.


texts: I would like to use GrumPHP with my Magento 2, to be able to run simple verifications during my development, how can I do that?


texts: magento 2 remove mini cart item page reload?

texts:
How can I reload the page when I remove mini cart item ?
I know it's Magento 2 bug.

On the checkout cart page there are many products In mini cart as well as In checkout cart page when I remove In mini cart, content not updated and I know it's a big thing to update checkout cart page content using Ajax so I am thinking about when customer remove item from cart I need to reload the page.


texts: Magento 2: About CRON readiness check issues

texts:
In Magento 2.2.

I have this problem, but I don't have root permissions because I was using web hosting.
http://devdocs.magento.com/guides/v2.2/install-gde/trouble/readiness/tshoot_rc_cron.html

so, How can I do?


texts: Change product price via tabs related products

texts:
in details product page i use easy tabs with related products, now i want when user check checkbox product in tabs change and total price in details page

http://prntscr.com/49e1by

how i can do this?

Thanks


texts: Get default store id from current website Magento 2

texts:
I'm implementing module which will change the store id for current webiste but not the default store id like this:

$this->_storeManager->setCurrentStore($storeId);

In magento 2 backend i've configured default store view for my current website like this:

the problem is i need to get this default store id from current website in my observer so i can do some function, roughly what i need like this:

$storeId = $this->getDefaultStoreId(); //this is what i need!!
$customStoreId = $this->getCustomStoreId(); //this is my function to get custom store id, nvm this
if($customStoreId){
  $this->_storeManager->setCurrentStore($customStoreId);
} else{
  $this->_storeManager->setCurrentStore($storeId);
}


texts: How do i get the value of size attribute as XXL? As I want to display a div if size of product is XXL

texts:
            <?php foreach ($products as $product): ?>

                    <a class="product-image" href="<?php echo $product->getProductUrl(); ?>">

<button class="button button--s button--inverted">Quick View</button>

                        <picture class="pimg1">
                            <source srcset="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(290, 290); ?>" media="(min-width: 400px)">
                            <img srcset="<?php echo $this->helper('catalog/image')->init($product, 'small_image')->resize(130, 130); ?>" alt="<?php echo $this->escapeHtml($this->getImageLabel($product, 'small_image')); ?>">
                        </picture>
                                                <picture class="pimg2">
                            <source srcset="<?php echo $this->helper('catalog/image')->init($product, 'thumbnail')->resize(290, 290); ?>" media="(min-width: 400px)">
                            <img srcset="<?php echo $this->helper('catalog/image')->init($product, 'thumbnail')->resize(130, 130); ?>" alt="<?php echo $this->escapeHtml($this->getImageLabel($product, 'thumbnail')); ?>">
                        </picture>
                        <?php

                        // GravDept:
                        // Check if product is new.
                        $isNewProduct = Mage::helper('magefrontend')->isNewProduct($product);
                        ?>
                        <?php if ($isNewProduct): ?>

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

                        <?php endif; ?>

                                                    now in plus sizes


texts:
As a newbie, I just installed the M.Community Full Release with Sample Data 2.0.5 on Win8 64bit with Xampp -- all went well so far, except arriving in the backend panel the "Admin Icons" are replaced by not resolvable symbols because the font is missing, in the setup.css, a font "Admin Icons" is referenced, which doesn't exist in any folder.

But basically, I can't find any font in any folder that actually displays icons (a Windows prob?).


texts: How to use local.xml to insert a block in Magento 1.8?

texts:
How can I use local.xml to insert a block?

I want to insert the static block (identifier: footer_links) from the cms into this footer block inside my page.xml, but before footer_links,

<block type="core/template" name="bottom.footer" as="bottom.footer" template="page/html/footer-bottom.phtml">
   <block type="page/switch" name="store_switcher" as="store_switcher" template="page/switch/stores.phtml"/>
   <block type="page/template_links" name="footer_links" as="footer_links" template="page/template/links.phtml"/>
</block>

this is the config in my local.xml,

<block type="cms/block" name="cms_footer_links" before="footer_links">
 <!--
                The content of this block is taken from the database by its block_id.
                You can manage it in admin CMS -> Static Blocks
            -->
<action method="setBlockId"><block_id>footer_links</block_id></action>
</block>

is it possible?

EDIT:

local.xml

<?xml version="1.0"?>

<layout>
    <default>

        <!-- removing blocks -->
        <remove name="paypal.partner.right.logo"/>
        <remove name="tags_popular"/>
        <remove name="right.permanent.callout"/>
        <block type="cms/block" name="cms_footer_links" before="footer_links">
            <!--
                The content of this block is taken from the database by its block_id.
                You can manage it in admin CMS -> Static Blocks
            -->
            <action method="setBlockId"><block_id>footer_links</block_id></action>
        </block>

    </default>

</layout>


texts: Edit Customer Account Information without setting address?

texts:
I'm using Magento CE 1.9.2 with all latest security patches applied.

I'm trying to edit a customer's account information to give them access to the 'Trade/Invoice' payment method I have set up. However, when I click 'Save Customer' it says that the 'Address' information is required, and I am therefore unable to edit the customer without entering dummy information into the customer's address - which I'd rather not do.

There must be a way to change a customer's account information without having to enter an address.


texts: How do I Pre-load Simple Products Tier Pricing of Configurable Product using JSON?

texts:
Currently, I am using the following code in view.phtml to retrieve tier price data:

var Tier_Prices = <?php echo json_encode($_product->getTierPrice()) ?>;

This only works for simple products and not configurable products that contain simple products. The output on the configurable products shows as:

var Tier_Prices = [];

My question is how do I retrieve or preload tier price data from a configurable product that contains multiple simple products?


texts: customer use wrong country for enjoying free shipping cart rules

texts:
The situation is i've setup a freeshipping for a country e.g Hong Kong, but the customers use a shipping address (address and city) in Korea, but they use hong kong as shipping country, and then they finally checkout with free shipping.

Do anyone know what any method, plugins, so i can avoid the above situations?


texts: Order Shipment email template in get Base Cost of Iteams..How to Get base Cost in magento1?

texts:
Order Shipment email template in get BaseCost of Iteams..How to Get base Cost??
Use this code but not getting Base cost..

$shipment = Mage::getModel('sales/order_shipment')->loadByIncrementId($shipid);
$itemsCollection = $shipment->getItemsCollection();
foreach($itemsCollection as $item)
{
    $baseCost= $item->getBaseCost();
}

Same as need to set Email Template.


texts: How add tier price to all child product of configuable product magento 2

texts:
Preconditions
Magento version 2.1.x

Steps to reproduce

Create one product configurable
Config child product list
Set tier price for all child product

In magento 1, if i need set tier price to all child product with same price, i set tier price at product configuable, it so easy.
Actual result

In magento 2, if i want set a tier price for all child product, i have to go every child product to config it, if i have 20 30 child product or more than, i have do it 20 30 time ?

How do it easier?


texts: I need to know that how can I add multiple vendor cost customization on shopping cart page

texts:
Basically, I have 5 vendors so I need to add shipping cost like this.

If any customer selects one product from the first vendor then price
added 15 dollars.
And if user select product from any other vendor then prices added
10 dollars in shipping cart.

So I need any tutorials or extension or any code please help ASAP.


texts: How to Remove comma from price in spanish locale for magento 2

texts:
Website with two Stores with different language.

1. English Language
2. Spanish Language

I have issue with Spanish Language store Price/Currency display as decimal Comma instead of dot.

Please refer this images for different sections,

In above picture for spanish store, Price display as $52,00 instead of $52.00 for Product Page.

In above picture,Subtotal price display as $1.344,00 instead of $1,344.00 for spanish locale in checkout page

In Cart Page, Price also display as comma instead of Dot decimal.

  For English store Pricing are display Proper format.

I want to set Pricing in spanish locale same as English locale.

  For Spanish Locale store, Pricing display as Comma instead of decimal
  point and Display Decimal Point instead of Comma.

Same link for magento 1, magento 1 spanish locale
How to do same in magento 2?

Thanks.


texts: How to display additional attributes in category page product item

texts:
Please check the below images for more understanding

Display here...


texts: Wrong image path after migration from 1.9.4 to 2.3

texts:
I have an issue about the image URL after a migration from Magento 1.9.4 to 2.3.
I have some products images which are displayed and some which are not.
Then I found out the reason which is due to some letter that should be an uppercase or lowercase.

Example:

Image not displayed
pub/media/catalog/product/cache/2765542505660baab28ecd555e27366e/v/r/vrac_5.jpg

Image displayed
pub/media/catalog/product/cache/2765542505660baab28ecd555e27366e/V/r/vrac_5.jpg

Does had this issue before? And have a solution to fix this ?


texts:
Prodcut not shown in single page view and shows Programming Code   check  this link

i am use magento CMS 1.9

Cache flash
all re-index
compiler disable


texts: Updateting the price and qty from csv file at the same time

texts:
The old script we had was updating the qty. I added price column to the csv file, then I realized still it only updates the qty. Do I miss any required changes? (Our update script is not specific for certain filed)

old

"sku","qty","stock_code"

New

"sku","qty","price","stock_code"

updating part in the script

$batchModel = Mage::getSingleton('dataflow/batch');
  if ($batchModel->getId()) {
    if ($batchModel->getAdapter()) {
      $batchId = $batchModel->getId();
      $batchImportModel = $batchModel->getBatchImportModel();
      $importIds = $batchImportModel->getIdCollection();
      $batchModel = Mage::getModel('dataflow/batch')->load($batchId);
      $adapter = Mage::getModel($batchModel->getAdapter());
      foreach ($importIds as $importId) {
        $recordCount++;
            flush();....

Update:

Something weird I encountered, if I run the profile from admin panel it updates all the fields, how ever running from command line does not have effect! what could cause this?


texts:
Magento2 - PWA. I am developing PWA in Magento2. In products I am not able to see Add to compare link.
How can I create add to compare REST API & use it in PWA?


texts: Permission file error when save options in admin panel

texts:
I have a problem with the Magento administrator, when I try to save any changes that are inside

  Content > Settings or Content > Blocks

I get the following error and could not correct it.

I already changed the permissions and I do not know what else to do.

find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod u+x bin/magento

Additional information

PHP version 7.0
Apache 2.2.31
Magento 2.1.6

Please, what should I do?

Image of error


texts:
magento 2 how to run indexer command command every 5 mins or is we have any backend option for run the indexer command in magento 2 ?
My problem is when change the status from disable to enable salable quantity not updated once run the indexer command it will updated so i need to run this command every 5 mins. magento  have any backend options for this?
What is the purpose of this cron scedule tab in backend


texts: help me find event magento2. In magento we have event catalog_product_after_save this event in magento2-rc?


texts: Magento 2: how to get json posted data in payment method

texts:
Magento is posting payment detail in json format on rest/default/V1/carts/mine/payment-information

Method post

{"cartId":"3","billingAddress":{"countryId":"US","regionId":"0","postcode":null,"saveInAddressBook":null
},"paymentMethod":{"method":"test_method","additional_data":{"testing":"abcdef"
,"temail":"test@test.com"}}}

how to get additional data in my validation method

public function validate()
      {
          /*
           * calling parent validate function
           */
          parent::validate();

          return $this;
      }


texts:
We have installed Venus theme Megamenu PRO plugin into Magento 2 site. After installing it, we can see that they are providing an option Custom CSS to write CSS into the admin panel. Please see the screenshot:

Here's my query, what will happen if I write the CSS on there and update the Magento version. Do the CSS will be removed from the admin panel?.

Could anyone please guide me?


texts:
in My/Stuff/etc/config.xml

<global>
    <models>
        <newsletter>
            <rewrite>
                <subscriber>My_Stuff_Model_Subscriber</subscriber>
            </rewrite>
        </newsletter>
    </models>
 (...)

in My/Stuff/Model/Subscriber.php

class My_Stuff_Model_Subscriber extends Mage_Newsletter_Model_Subscriber {

    public function sendConfirmationSuccessEmail()
    {
        Mage::Log('My_Stuff_Model_Subscriber::sendConfirmationSuccessEmail()');
    }
}

Mail was send but why is sendConfirmationSuccessEmail() not triggered?

My workaround is to copy Mage_Newsletter_Model_Subscriber to local and that works but override should be cleaner.


texts: Magento 2.2.6: Mini cart qty not updated after I add cart items programatically

texts:
I use the QuoteFactory in order to load the quote by id & add items. Then I save the quote & call $quote->setTotalsCollectedFlag(false)->collectTotals().
After that, I can see on the database that the quote item have been added & on the frontend I also see the right qty on the cart page, but the mini-cart on the header stays the same.
When I sign out & in again it gets updated.
*My guess is that I need to somehow force the customerData to reload on frontend (customerData.reload(['cart'])), but I don't know how/if it's possible to performs that on the server side...

-- Any idea?


texts: Magento 2.3.0: Error when trying to generate shipment more than 3 products

texts:
When trying to make shipment of order having more than 3 products then it showing below error -

Anybody face this type of issue , please suggest.


texts:
Shop Now button is coming from addtocart.phtml file.

I want to display Shop Now button after image. After image, content is coming from view.phtml file.

In catalog.xml file , I am trying to move block but no effect

   <block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"/>
   <block type="catalog/product_view" name="product.info.addto" as="addto" template="catalog/product/view/addto.phtml"/>
   <block type="catalog/product_view" name="product.info.addtocart" as="addtocart" template="catalog/product/view/addtocart.phtml"/>

I want to put Shop Now Button after media file.


texts: Importing "Ø" (special character) in Magento

texts:
I had a lot of problems with the Export and Import of Products through a CSV file.

My main issue is that in Germany MS Excel generally uses ";" as a delimiter instead of ",".
I tried a few work arounds, but in the end now I changed Mangeto's delimiter settings so I export and import with ";" as delimiter, now the CSV file is beeing correctly displayed in MS Excel.
 1. Question: What do you think about that?

A lot of products use the "Ø"-sign for the diameter of our round carpets in the shop, yes we sell carpets by the way.
I got the error "sku is not defined" for around 200/500 rows, I found out that this issue is due to the "Ø", because when I replaced this sign, everything worked fine. The strange thing about that is, that I am pretty sure, well 99,9% sure, the import of products with "Ø" in the name worked before. It may be that I had different System settings for Windows and maybe different coding settings in MS Excel, everything got a little bit confused and changed, maybe that is the reason.
 1. Question: Do you know if it is possibe for me to import with special characters like "Ø" and if yes, how? Btw I use "alt" + "0216" (German keyboard) for this sign.

Kai


texts: How to redirect the specific product page when i click the add to cart button instead of add the product to cart in magento 2.3.2

texts:
I want to redirect the specific product page when i click the add to cart button instead of add the product to cart in magento 2.3.2

If anyone know the answer please share the exact code and folder structure since i'm new to magento.


texts: Frontend Customer Creation - disable password

texts:
I need to remove the password/ confirm password fields from customer creation page, I´d tried to use this post as source trying to solve this by random genarate password and edited this files
\theme\template\customer\form\register.phtml and \theme\template\persistant\customer\form\register.phtml

and the fields are still showing up.

Any better way to do that or any other files that I should change it either?

Edit: Code-snippet as requested

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

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

                    <?php $password = Mage::helper('core')->getRandomString($length = 7)?>

<input type="hidden" name="password" id="password" title="<?php echo $this->__('Password') ?>" class="input-text required-entry validate-password" value="<?php echo $password?>"  />

                *<?php echo $this->__('Confirm Password') ?>

                    <input type="hidden" name="confirmation" title="<?php echo $this->__('Confirm Password') ?>" id="confirmation" class="input-text required-entry validate-cpassword" value="<?php echo $password?>" />

I also had tryied to change the Title "Create Account" in these same pages and it´s not showing on frontend as well.

I thought about a template hint extension to see where Magento is calling this templates from, however I´m not finding any still active for 1.x versions.


texts: Error: "Cannot send headers", when fetching table data (direct SQL query)

texts:
I want to get a variable from a table of another module. I followed this tutorial: https://fishpig.co.uk/magento/tutorials/direct-sql-queries/

$resource = Mage::getSingleton('core/resource');

$readConnection = $resource->getConnection('core_read');

$query = 'SELECT * FROM ' . $resource->getTableName('catalog/product');

$results = $readConnection->fetchAll($query);

var_dump($results);

and it works great for catalog/product table.Then I tried to do the same thing for the custom table from a module:  $query = 'SELECT * FROM ' . $resource->getTableName('amtable/rate'); I concluded that the "table name" should be amtable/rate by following this comment and looking at the config.xml: <global>
        <models>
            <amtable>
                <class>Amasty_Table_Model</class>
                <resourceModel>amtable_mysql4</resourceModel>
            </amtable>
            <amtable_mysql4>
                <class>Amasty_Table_Model_Mysql4</class>
                <entities>
                    <method>

am_table_method

                    </method>
                    <method_store>

am_table_method_store

                    </method_store>
                    <rate>

am_table_rate

                    </rate>
                </entities>
            </amtable_mysql4>

But I get an error:  Cannot send headers; headers already sent in app/code/local/Jurgis/Mymodule/controllers/IndexController.php, line 15 Line 15 is: var_dump($results); What could I be doing wrong or is there something I'm missing?  P.S. sorry about the formatting, couldn't figure out how to fix it.


texts:
I want to add a new search type option in Magento admin configurations section. Please find the attached image for more clarification.

How to achieve this?


texts: unable to place order. Please try again later in magento 2.1 C E

texts: Unable to place order. Please try again later in Magento 2.1 C E, till now it was working.


texts: Promotions/Catalog Price Rules - Applying product's price rule only for 2 days

texts:
I am facing a problem with my Magento (ver. 1.8.0.0) and Catalog price rules.

I have placed a Catalogue Rule in Promotions/Catalog Price Rules. The Rule is 15% discount of a Customer Group in a specific product Category, until the end of this month (To Date 7/31/14).

Before some days, I realized that when I was logged into the customer group, I could see the discount prices normally in the Category view. But, when I clicked on a product, the discount price has not being applied to the item, although in the category I view the Discount but the product itself has no discount at all!

After trying almost everything, I realized that changing "From Date" to 48 hours back from present date, everything worked fine. So, I login everyday and change the "From Date" to 1 day before my present date and the issue disappears, but this is not a solution at all!

Is there any help for this issue?

  *For testing purposes, you can check at: http://pathart.gr/
  The discount category is: http://pathart.gr/season.html
  email: mytest@customertest.gr
  pass: letmein


texts: Recently viewed product not working properly in home page

texts:
I added recently viewed product block in home page it's fetching properly recent view product if i used same code in some other page it working fine. I don't know what is the problem can you please suggest

<?php if ($_products = $this->getRecentlyViewedProducts()): ?>

Recently Viewed Product

        <?php foreach ($_products as $_item): ?>

                <a href="<?php echo $this->getProductUrl($_item) ?>">
                    <img src="<?php echo $this->helper('catalog/image')->init($_item, 'thumbnail')->resize(185, 185)->setWatermarkSize('30x10'); ?>" width="185" height="185" alt="<?php echo $this->escapeHtml($this->getProductName()) ?>" />

                        <a href="<?php echo $this->getProductUrl($_item) ?>">
                            <?php echo $this->helper('catalog/output')->productAttribute($_item, $_item->getName() , 'name') ?>

                <?php echo $this->getPriceHtml($_item, true, '-new') ?>

        <?php endforeach; ?>

<?php endif; ?>


texts: I can't reference content to add block in content. I try adding block to head and it works. But not the content.


texts: Customer Custom Attribute and Save Value when Save Customer

texts:
I have to add custom Dropdown attribute to customer. Which have 3 options like Pending, Approved and Disapproved. So when we save customer i have to save this field value.

For this i have added field in the database table and created Dropdown in admin side form. but i am not understanding how to save this field data.

When status is changed also i have to send email. I am thinking to override Save controller of admin but not sure.

Please help me.


texts: Is it possible to get the reason that a coupon code is invalid? For example, if I have a shopping cart rule that specifies that the order subtotal must be $100 or more, and the user tries to use the coupon on a subtotal that is only $75, could I show a message along the lines of "your cart must be $100 or more"?


texts: Custom cron not working in magento 2.2.6

texts:
I Have created the custom cron in my custom module. crontab.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Cron:etc/crontab.xsd">
<group id="default">
<job name="samplecron" instance="Learning\GreetingMessage\Cron\Run" method="execute">
<schedule>*/1 * * * *</schedule>
</job>
</group>
</config>

Then run.php

<?php
namespace Learning\GreetingMessage\Cron;
class Run
{
   protected $_logger;
   protected $_oredrcontroller;

   public function __construct(
       \Psr\Log\LoggerInterface $logger,
        \Learning\GreetingMessage\Controller\Index\Test $ordercontroller
   )
    {
     $this->_logger = $logger;
     $this->_oredrcontroller = $ordercontroller;
    }

   public function execute()
   {
       $this->_oredrcontroller->execute();
       $this->_logger->debug('Cron run successfully');
       return $this;
   }
}

I execute following commands in terminal

php bin/magento setup:upgrade
php bin/magento cache:flush
sudo chmod -R 777  .
php bin/magento cron:run

But my cron not working. In the function contorller \Learning\GreetingMessage\Controller\Index\Test execute . I wrote code to update values in my table. Nothing happens


texts: Magento 2 - Where Knockout js variable are defined?

texts:
In Magento 2 I don't understand how knockout js templates work.

In this file : vendor/magento/module-checkout/view/frontend/web/template/summary/item/details.phtml

I need to know where html: $parent.name and text: $parent.qty are defined, in order to change these values.

Thanks for your help.


texts:
I couldn't install extension anymore using Magento Connect Manager. I can login to Magento Connect Manager, but every step that I did, it always show the login form again even if I tried to enter the correct login account, the connect manager never installed my extension. The re-enter password always loop when I'm trying to do something in the Magento Connect Manager.

Could someone help me to fixed this weird thing?

SOLVED

now i have another problem but this time when i install a new template, Show this

I've tried this but nothing happen,

  find var vendor pub/static pub/media app/etc -type f -exec chmod u+w {} \;

  find var vendor pub/static pub/media app/etc -type d -exec chmod u+w {} \;

  chmod u+x bin/magento


texts: Magento 2.3.x - How can I add fixed tier price for bundle products?

texts:
It seems that Magento has dropped the customer group price on M2 and now we use a sort of conditional tier price for this.
I've done this on M1 for customer group but I don't have the level yet to do it on M2.
I would like to allow fixed tier prices for bundle products. ATM only percent discount is allowed.

Any help or advise would be much appreciated.
Thank you


texts: How to translate SKU# on detail page on Magento 2

texts:
I try to translate SKU# on my Magento 2 detail page. But it doesn't work. I found this for Magento 1:
how to rename the SKU label?

And need a simular solution for Magento 2.

Thanks.


texts: Magento 2: It shows me products out of stock

texts:
In the product information, going to the next product shows me some that are out of stock.

I have the configuration that there are no products out of stock ...

Edit:

I think the problem comes from here and should filter the products looking at the stock:

  public function getCategoryProductIds($current_category) {
    $category_products = $current_category->getProductCollection()
        ->addAttributeToSelect('*')
        ->addAttributeToFilter('is_saleable', 1, 'left')
        ->addAttributeToSort('position','asc');
    $cat_prod_ids = $category_products->getAllIds();

    return $cat_prod_ids;
}

How do I filter the products in stock?

Template

    <?php
    $porto_helper = $this->helper('Smartwave\Porto\Helper\Data');
    $product_view = $porto_helper->getConfig('porto_settings/product');
    $_helper = $this->helper('Magento\Catalog\Helper\Output');
    $_imagehelper = $this->helper('Magento\Catalog\Helper\Image');
    if(isset($product_view['prev_next']) && $product_view['prev_next']) {
        $_product = $block->getProduct();
        $prev_product = $porto_helper->getPrevProduct($_product);
        $next_product = $porto_helper->getNextProduct($_product);

Helper

public function getPrevProduct($product) {
    $current_category = $product->getCategory();
    if(!$current_category) {
        foreach($product->getCategoryCollection() as $parent_cat) {
            $current_category = $parent_cat;
        }
    }
    if(!$current_category)
        return false;
    $cat_prod_ids = $this->getCategoryProductIds($current_category);
    $_pos = array_search($product->getId(), $cat_prod_ids);
    if (isset($cat_prod_ids[$_pos - 1])) {
        $prev_product = $this->getModel('Magento\Catalog\Model\Product')->load($cat_prod_ids[$_pos - 1]);
        return $prev_product;
    }
    return false;
}
public function getNextProduct($product) {
    $current_category = $product->getCategory();
    if(!$current_category) {
        foreach($product->getCategoryCollection() as $parent_cat) {
            $current_category = $parent_cat;
        }
    }
    if(!$current_category)
        return false;
    $cat_prod_ids = $this->getCategoryProductIds($current_category);
    $_pos = array_search($product->getId(), $cat_prod_ids);
    if (isset($cat_prod_ids[$_pos + 1])) {
        $next_product = $this->getModel('Magento\Catalog\Model\Product')->load($cat_prod_ids[$_pos + 1]);
        return $next_product;
    }
    return false;
}


texts: how to override new_grid.phtml file without custom theme?

texts:
I want to override new_grid.phtml file in Luma theme.
I have the file at below path

app/design/frontend/Magento/luma/Magento_Catalog/templates/product/widget/new/content/new_grid.phtml

It is not working with it. Could you please help me? I am not using custom theme.


texts: How do I set the availabe of a payment method to false?

texts:
I want to set a payment method by using the payment code to false. This is how I get a list of active paymentcode in checkout:

$payments = Mage::getSingleton('payment/config')->getActiveMethods();

        foreach ($payments as $paymentCode=>$paymentModel) {
           if($paymentModel->canUseCheckout() == 1){
                $paymentTitle = Mage::getStoreConfig('payment/'.$paymentCode.'/title');
                $methods[$paymentCode] = array(
                    'label'   => $paymentTitle,
                    'value' => $paymentCode,
                );
           }
        }

but i don't know how do i set it to false using the payment code ?


texts:
We are using the payment method Cashondelivery.

When creating an invoice in the backend, there is no option to select "pending payment". The invoice is created always as paid.

How can this be fixed?


texts:
I just truncated the cron_schedule table.After that jobs are not getting scheduled.The table is always empty.Any ideas ?

Thank you


texts: I am having a strange issue when uploading an image through the backend of magento. I currently have my /media/ permissions set to 777, however whenever I upload an image it changes the permissions to 600 which makes it not viewable until I change it manually back to 777. Is there a way to set it as default to be 777?


texts:
I want to use a remote host for my magento 2. the problem is even if I have set the host to remote in env.php, it is still using localhost. it seems the value for the host is just ignored.

   array (
    'model' => 'mysql4',
    'engine' => 'innodb',
    'initStatements' => 'SET NAMES utf8;',
    'host' => 'my_remote_host',
    'dbname' => 'my_db',
    'username' => 'my_username',
    'password' => 'my_password',
    'active' => '1',
  ),

I have cleared the cache by using.

  php bin/magento cache:flush

I have cleared the cache in browser too.
It looks like my Magento 2 is simply ignore the value i set to the Host in env.php and keep using localhost as default.


texts: How to display video as thumbnail image in magento

texts: How to display YouTube video as thumbnail image in Magento?


texts: how to add Category tree structure like product edit/add in custom module

texts: I want to add category tree structure in my custom module like Product Edit/Add.


texts: main.WARNING: Memory size allocated for the temporary table is more > than 20% of innodb_buffer_pool_size. Strange values

texts:
I'm receiving the following alert from Magento2:

main.WARNING: Memory size allocated for the temporary table is more
than 20% of innodb_buffer_pool_size. Please update
innodb_buffer_pool_size or decrease batch size value (which decreases
memory usages for the temporary table). Current batch size: 100000;
Allocated memory size: 130000000 bytes; InnoDB buffer pool size:
536870912 bytes. [] []

But 130000000 bytes is less than 536870912 bytes!!!!
Where I'm wrong?
I'm going to decrease bath size as described here but I think there are other problems


texts: Change Label for Telephone on Checkout Page

texts: I would like to know where can I edit the label for the form under "Billing Information" One page Checkout?


texts: I have two websites in Magento installation. I need to remove the current base website completely. Can I just delete the default website or are there other steps to do?


texts:
Suddenly Magento does not display any blocks anymore in the frontend.
Also in the backend under content, blocks and pages are missing.
I flushed my cache but there is no change.
Additionally there is nothing in the error logs.
They are still saved to the database cms_block table and flagged as is_active.

What could be wrong? Did I change some setting that can cause this?


texts: Duplicate current quote with new ID on Magento 2

texts:
Is there a way to somehow take the existing quote and create a new one identical to it but with a new ID?

This is what I currently have:

Updated following suggestions from @Vishwas:

use Magento\Framework\App\Action\Context;
use Magento\Framework\Controller\ResultFactory;
use Magento\Store\Model\StoreManagerInterface;
use Magento\Quote\Model\QuoteRepository;
use Magento\Framework\Mail\Template\TransportBuilder;
use Magento\Framework\Translate\Inline\StateInterface;
use Magento\Checkout\Model\Cart;
use Magento\Catalog\Model\ProductFactory;

class ShareCart extends \Magento\Framework\App\Action\Action
{
    protected $resultFactory;
    protected $storeManager;
    protected $quoteFactory;
    protected $transportBuilder;
    protected $stateInterface;
    protected $cart;
    protected $productFactory;

    public function __construct(
        Context $context,
        ResultFactory $resultFactory,
        StoreManagerInterface $storeManager,
        QuoteRepository $quoteFactory,
        TransportBuilder $transportBuilder,
        StateInterface $stateInterface,
        Cart $cart,
        ProductFactory $productFactory
    ) {
        $this->resultFactory = $resultFactory;
        $this->storeManager = $storeManager;
        $this->quoteFactory = $quoteFactory;
        $this->transportBuilder = $transportBuilder;
        $this->stateInterface = $stateInterface;
        $this->cart = $cart;
        $this->productFactory = $productFactory;

        parent::__construct($context);
    }
    public function execute()
    {
        try
        {
            $post = (array) $this->getRequest()->getPost();

            $id = $this->cart->getQuote()->getId();

            if ($id > 0) {
                $quote = $this->quoteFactory->get($id);
                $items = $quote->getAllVisibleItems();

                foreach ($items as $item) {
                    $productId = $item->getProductId();
                    $_product = $this->productFactory->create()->load($productId);

                    $options = $item->getProduct()->getTypeInstance(true)->getOrderOptions($item->getProduct());

                    $info = $options['info_buyRequest'];
                    $request1 = new \Magento\Framework\DataObject();
                    $request1->setData($info);

                    $this->cart->addProduct($_product, $request1);
                }
                $this->cart->save();

                // Retrieve form data
                $email   = $post['basketshare-email'];
                $message = $post['basketshare-message'];

                $from_name = "";
        }
    } catch (\Exception $e) {
        $this->messageManager->addError(__($e->getMessage()));
    }
}

}

UPDATE:

    $this->cart->addProduct($product, $request);

}

// save the updated cart items then re-attach the cart to the original quote
$this->cart->save();
$this->cart->setQuote($quote);
$this->checkoutSession->setQuoteId($quote->getId());
$this->cart->save();

I think there is something I'm not doing right here but I'm struggling to find any help on Google at the moment :)


texts: How to set discount amount when create order programmically

texts:
I have created an order pragmatically and invoiced it forcefully to complete order when I check order under sales->order it shows the order completed but discount column always with zero amount.How to show given discount on products in invoiced.please help

below is my code working fine but need to add discount price.

  $customer = Mage::getModel('customer/customer');
    $customer->setStore($store);
    $quote = Mage::getModel('sales/quote');
    $quote->setStore($store);
    $hasCustomer=$_REQUEST['hasCustomer'];
    if($hasCustomer=='existing'){
        $customer->loadByEmail($_REQUEST['customerEmail']);
        $quote->assignCustomer($customer);
        $billingAddress = $quote->getBillingAddress()->addData($customer->getPrimaryBillingAddress());
       $shippingAddress = $quote->getShippingAddress()->addData($customer->getPrimaryShippingAddress());
    }
    else
    {
         $quote->setCustomerEmail($_REQUEST['customerEmail']);
         $addressData = array(
        'firstname' => ' ',
        'lastname' => ' ',
        'street' => ' ',
        'city' => 'NULL',
        'postcode' => 'NULL',
        'telephone' => '123456',
        'country_id' => 'US',
        'region_id' => 12,  );
        $billingAddress = $quote->getBillingAddress()->addData($addressData);
        $shippingAddress = $quote->getShippingAddress()->addData($addressData);
    }
    $productIds=array();
    $products=$_REQUEST['productIds'];
    $products=str_replace(array( '[', ']' ), '',$products);
    $productIds=explode(',',$products);
    $quant=$_REQUEST['quantity'];
    $quant=str_replace(array( '[', ']' ), '',$quant);
    $quantities=explode(',',$quant);
    $salesReport=array_combine($productIds,$quantities);
    foreach($salesReport as $ids=>$qty)
    {
        $product1 = Mage::getModel('catalog/product')->load($ids); /* HTC Touch Diamond */
        $buyInfo1 = array('qty' => $qty);
        $quoteItem=$quote->addProduct($product1, new Varien_Object($buyInfo1));
     }
    $shippingAddress->setCollectShippingRates(true)->collectShippingRates()
        ->setShippingMethod('freeshipping_freeshipping')
        ->setPaymentMethod('checkmo');
    $quote->getPayment()->importData(array('method' => 'checkmo'));
    $quote->setDiscountAmount('2');// I have doubt here
    $quote->collectTotals()->save();
    $service = Mage::getModel('sales/service_quote', $quote);
    $service->submitAll();
    $order = $service->getOrder();

    $invoice = Mage::getModel('sales/service_order', $order)->prepareInvoice();
    $invoice->setRequestedCaptureCase(Mage_Sales_Model_Order_Invoice::CAPTURE_ONLINE);
    $invoice->register();
    $transaction = Mage::getModel('core/resource_transaction')
             ->addObject($invoice)
            ->addObject($invoice->getOrder());
    $transaction->save();
    $order->setData('state',"complete");
    $order->setStatus("complete");
    $history = $order->addStatusHistoryComment('Order marked as complete automatically.', false);
    $history->setIsCustomerNotified(false);
    $order->save();
    $id=$order->getId();

In short I want to show orders with discount column price value that I have to give with request method.


texts: Magento 2 - url.build does not work for admin url

texts:
I have tried url.build to build request url for ajax call in magento 2, it does not work ?

JS File code: ( view/adminhtml/web/js/files.js)

/*global window,requirejs*/
requirejs(['jquery', 'Magento_Ui/js/modal/confirm', 'mage/url'], function ($, confirmation, urlBuilder) {
    'use strict';
    $('body #custom_email_button').on('click', function () {
        var requestUrl = urlBuilder.build('productpricequote/email/send');
        console.log(requestUrl);
    });
});

Output:

'productpricequote/email/send'

Any help much appreciated!

Thanks


texts: Magento 1. Copy all product attribute Labels and Options from storeview 1 to storeview 2

texts:
So we have created a new store. Only to see that wee have to manually OPEN and COPY all product attributes Labels and Options 1 by 1. Storeview X already has the correct Labels and Options.

Question: Is there a method to copy ALL product attributes Labels and Options from a certain storeview and store them to the new storeview?

Loop over product attributes
Get value from root storeview = X
Copy to storeview = Y


texts:
JS for my main page is working..for example, I am using main_file.js for my default loaded page. Which is actually working properly.
but I have a search option on my default page which leads to some other .phtml file (named as second..phtml). js used for that .phtml is not working. even I have included it in the .xml file too.
This is how I declare js in .xml file for my default page .phtml
<script src="[CP_MODULE]::js/main_quickorder.js"/>

this how I declare js in .xml file of second .phtml.
<script src="[CP_MODULE]::js/test2.js"/>

first one is working properly but second one is not working.


texts: Unable to send confirmation email to subscribers

texts: when I subscribe for newsletter after that a subscription email should sent but I am not getting that email but user are added in subscriber list on admin side. And nor the notification of   thank you for subscription. what maybe possible issue ?


texts: adding media_image attribute sql catalog

texts:
$installer = $this;
$installer->startSetup();
$this->addAttribute(Mage_Catalog_Model_Product::ENTITY,'expert_author_image',
    array (
        'group'             => 'Expert recommandation',
        'type'              => 'varchar',
        'label'             => 'Expert author image',
        'input'             => 'media_image',
        'is_configurable'   => 1,
        'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_STORE,
        'visible'           => true,
        'default'           => '',
        'class'             => '',
        'source'            => '',
        'sort'              => '6'
    )
);
$installer->endSetup();

it add image to images folder where product image is but not to seperate group


texts: Cron job to delete catalog_product_entity_datetime table data, am I using the correct interface?

texts:
I have a query to select data from catalog_product_entity_datetime table.
can I use below interface to grab the data from above table? If can't what should I do to grab data from this table?
I don't get it how to use below interface to grab data without specify which table?
`use \Magento\Catalog\Model\ResourceModel\Product\Collection`;

my query,
SELECT  * FROM `catalog_product_entity_datetime`
WHERE `attribute_id` IN (22,33) AND `store_id` IN (1, 2);

Delete return rolls from above query.
Here is my full code:
<?php

namespace ABC\CleanSpecial\Cron;

use \Psr\Log\LoggerInterface;
use \Magento\Framework\Stdlib\DateTime\TimezoneInterface;
use \Magento\Catalog\Model\ResourceModel\Product\Collection;

class Deleteresult {

  protected $logger;
  protected $timezone;
  protected $productCollection;

  public function __construct(
    LoggerInterface $logger,
    TimezoneInterface $timezone,
    Collection $productCollection
  ) {
    $this->logger = $logger;
    $this->timezone = $timezone;
    $this->productCollection = $productCollection;
  }

  public function execute() {
    $collection = $this->productCollection->create();
    $getAttributeIdData= array(22,33);
    $collection->addAttributeToFilter('attribute_id',array('in'=> $getAttributeIdData ));
    $getStoreIdData= array(1,2);
    $collection->addAttributeToFilter('store_id',array('in'=> $getStoreIdData ));
    $deleteRows = $collection->count();
    $collection->walk('delete');
    $date = $this->timezone->date()->format('d/m/Y H:i:s');
    $this->logger->info($deleteRows.' rows deleted from catalog_product_entity_datetime table at '.$date);
  }
}


texts: Magento 2: Cart price rule performance issue

texts:
I have imported 6.3 million coupon in Magento 2.3. I have performance issues on checkout page. When I apply coupon it takes lot of minutes. How to increase performance ?

I am running database on separate server which is fast and also I have setup  glera cluster.


texts:
I created stores with script in Magento 2.1
But I face an issue when I tried to access the store it returns 404 pages.

I tried to create a store from admin, and the store i created from admin. It works in frontend.

I do reindexing, Upgrade, Compile, and every basic step in Magento 2 debug.

I follow this to create a store view.

https://gist.github.com/0-Sony/1297fd13e11e9b901fa403a618b6cee5


texts: How is order created using onepage checkout?

texts:
I was trying to split my order based on the seller selling the product. I was able to split my order by overriding the saveOrder() function. But, the order totals were not splitting. The totals appearing was of the complete order.

So, I want to know how are the totals of the order are saved so that the totals could be split.

P.S.- I am using onepage checkout.

Please help.


texts: Magento 2 Class Catalog\Model\Product\Attribute\Backend\Media does not exist

texts:
When trying to edit or add a new product on the backend I receive the following error

  Class Magento\Catalog\Model\Product\Attribute\Backend\Media does not exist.

It stops me from editing or adding a product!
This has happened after importing a few products.


texts:
I'm having a 3rd party module that extends some controller (after updating from previous version that used to do it in a separate controller) that I need to extend with my own module already. Both have a completely different set of actions.

Is there a way to use both extensions (3rd party and own) without colliding?


texts: Magento 2 how can i change the icon of module in the menu list of admin

texts: How can i change the default icon of my module in admin menu list. If any one install my module then what he will see in the menu list the icon i put there or default icon.


texts: Adding External Javascript File in layout

texts:
I have been trying to add one external javascript file in my module and alert message from  it. In source page link to javascript is showing but alert message is not coming.
Here is Template code.

 <input type="submit" name="submit" onclick="validate()">

Layout Code

 <default>
        <reference name="head">
            <action method="addJs"></action>
  </reference>
</default>

and javascript file in js/Test/test.js

function validate(){
 alert("hello");
}


texts: Copy files from /vendor/* to another server? Mailchimp installation without composer

texts:
My shared hosting doesn't allow me to use composer install (php memory limit error). So I had to install to my clone magento2 on xampp server.

http://wiki.ebizmarts.com/installation-guide-m4m2
below are the two commands i use.

composer require mailchimp/mc-magento2 1.0.32
composer require ebizmarts/mailchimp-lib

i can see from my local copy that files are created in

vendor\mailchimp\mc-magento2\
vendor\ebizmarts\mailchimp-lib\

My question is can I just copy this two folder and upload to my live magento2 server, and run php bin/magento setup:upgrade ?


texts: Magento 2: How to display billing address first at checkout?

texts:
For some reason Magento 2 asks shipping details first at checkout. This is a bit problematic in some cases. For example if customer want's to pick up the order instead of it being shipped she does not understand why shipping details are asked in the first place.
There are also cases where customer's are puzzled when they need to give EU VAT ID and they have different billing and shipping addresses. They might give it only in shipping details and leave it out of the billing details. Or they might leave it our from the shipping details and give it only in billing details.
One case is that a company makes the order and company's name must be in the Billing address, but the order is going to be delivered to customer's personal address, so Shipping details might not have EU VAT ID at all and that results wrong VAT calculation because of tax settings (tax based on shipping destination).
We need the billing address to have the EU VAT ID so that it get's printed into Invoice. But it is also required to be in the Shipping details as the tax calculation is better to be based on shipping address than on billing address because of the EU VAT regulations in cross border sales where VAT is usually based on the customer's shipping destination country.
(Also problematic is the fact that when customer registers she already gives EU VAT ID, but that is not used in VAT calculations, but that is another story.)
Some of these problems might be avoided if billing address would be asked first. There should also be a checkbox "My billing and shipping address are the same" just below the Billing address fields. Is there a way to do these changes and what would be the effects?
I'm guessing that some extensions might use the shipping address, but would that be a problem if by default the checkout would save the billing address to be the same as shipping address?
One solution could also be that there would be a selection for the customer "Are you a business customer with an EU VAT ID?". Then it would present the VAT ID field only when needed and only once (not for shipping and billing separately).


texts: I have no-indexed URLs matching below pattern. Is there any other pattern that could be added?


texts: Currently in PDF invoices, the items are being sorted by the sequences when they are added into the cart.  How to sort the items in invoices by SKU”?


texts:
Want to know how to display "My Account" only after customer LogIn. After LogOut it will again be hidden on the same place. New to Magento 2

thx for help


texts: Magento 2 : Separate cms pages with different left side bar

texts: I want to create pages for shipping return , faqs and two others like this . But how can I add left bar to them like this ?


texts: Magento 2 - Category XML update to use custom list.phtml file

texts:
Using this code in the category XML update works to use my customlist.phtml file instead of the default list.phtml file.

But the problem is the category title and description are repositioned to the bottom of the page. I need them to be at the default position which should be at the top of the listed products.. what am i missing..

<referenceContainer name="content">
<referenceBlock name="category.products.list">
    <block name="product_list" class="Magento\Catalog\Block\Product\ListProduct">
        <arguments>
            <argument name="template" xsi:type="string">Magento_Catalog::product/customlist.phtml</argument>
        </arguments>
    </block>
</referenceBlock>


texts: Magento keeping old category url keys after re-name

texts:
After installing a Magento 1.9 that came with a theme pre-configured, I started to customize the category names from the placeholders. However, after renaming titles and erasing old url keys, the front end shows new titles but links to the old url keys no matter how many times I try to change them. The backend always shows the correct keys though.

I've flushed cache plenty of times, re-indexed plenty of times, but these place holder url keys remain. It's no local caching as it happens on other computers.

Are there any database tables I can check that might have the old values? I know of the url re-write table, but that technically shouldn't be affecting this, should it?


texts:
I use this code added into success.phtml when ever I run this code the webpage crashes. The success page just never loads and stays white. I'm sure its a simple mistake that I am making but I haven't been able to figure it out yet. So I figured i'd give it a shot on here.

This code is near the beginning of the file and works fine

$grayson_order_id = $this->getOrderId();
$order2 = Mage::getModel('sales/order')->loadByIncrementId($grayson_order_id);
$custname = $order2->getBillingAddress()->getName();

This code however does not work.

<?php
echo "a";
$lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
echo "b";
echo "
";
$order = Mage::getSingleton('sales/order');
echo "c";
echo "
";
$order->load($lastOrderId);
echo "c";
echo "
";
$totalAmount = $order->getData('base_grand_total');
echo "d";
echo "
";
echo "total amount ". $totalAmount;
echo "
";
$sellerId = Mage::getModel('core/cookie')->get('smashingmagazine_affiliate_source');
echo "e";
echo "
";
echo "aff id ". $sellerId;
echo "
";
$w = Mage::getSingleton('core/resource')->getConnection('core_write');
echo "f";
echo "
";
$result = $w->query('INSERT INTO grayson_custom (refer, time, amount, name, order_id) VALUES ('$sellerId', 'date('Y-m-d H:i:s')','$totalAmount','$custname','$this->getOrderId()')');
echo "g";
echo "
";

?>

I don't think it matters much but I am using Magento Enterprise Edition 1.13

Thanks for all your help!


texts: How to create category attribute of type int in Magento 2?

texts:
I am using Magento 2.3

I have created the Custom extension for category attribute "Popular category" and I have installed this extension successfully but the issue is I have set the default value as 0 but when I saw the attribute in admin it is already selected.

Here are the extension files:

  app/code/Custom/CategoryAttributes/Setup/InstallData.php

<?php

namespace Custom\CategoryAttributes\Setup;

use Magento\Framework\Setup\InstallDataInterface;
use Magento\Framework\Setup\ModuleContextInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Eav\Setup\EavSetup;
use Magento\Eav\Setup\EavSetupFactory;
use Magento\Catalog\Model\Category;
use Magento\Eav\Model\Entity\Attribute\ScopedAttributeInterface;

/**
 * @codeCoverageIgnore
 */
class InstallData implements InstallDataInterface
{
    /**
     * @var EavSetupFactory
     */
    private $eavSetupFactory;

    /**
     *
     * @param EavSetupFactory $eavSetupFactory
     */
    public function __construct(EavSetupFactory $eavSetupFactory)
    {
        $this->eavSetupFactory = $eavSetupFactory;
    }

    public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
    {
        /** @var EavSetup $eavSetup */
        $eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
        $eavSetup->addAttribute(
            Category::ENTITY,
            'popular_category',
            [
                'type' => 'int',
                'label' => 'Popular Category',
                'input' => 'select',
                'required' => false,
                'sort_order' => 100,
                'global' => ScopedAttributeInterface::SCOPE_STORE,
                'group' => 'General Information',
                'default' => 0,
                'visible_on_front' => true,
            ]
        );
    }
}

  app/code/Custom/CategoryAttributes/view/adminhtml/ui_component/category_form.xml

<?xml version="1.0" encoding="UTF-8"?>

<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
    <fieldset name="general">
        <field name="include_in_menu" sortOrder="100" formElement="checkbox">
            <argument name="data" xsi:type="array">
                <item name="config" xsi:type="array">
                    <item name="source" xsi:type="string">category</item>
                    <item name="default" xsi:type="string">0</item>
                </item>
            </argument>
            <settings>
                <validation>
                    <rule name="required-entry" xsi:type="boolean">false</rule>
                </validation>
                <dataType>boolean</dataType>
                <label translate="true">Popular Category</label>
            </settings>
            <formElements>
                <checkbox>
                    <settings>
                        <valueMap>
                            <map name="false" xsi:type="string">0</map>
                            <map name="true" xsi:type="string">1</map>
                        </valueMap>
                        <prefer>toggle</prefer>
                    </settings>
                </checkbox>
            </formElements>
        </field>
    </fieldset>
</form>

Attribute in admin:

As you can see attribute is already selected to "Yes" but I want it to be selected as "No" by default. So, how can I achieve this?

And also I am not able to use this attribute in the front end. So, How can I do this?


texts: display specific error message on coupon code instead of coupon not valid

texts: how it is possible to get the reason that a coupon code is invalid? For example, if I have a shopping cart rule that specifies that the order subtotal must be Rs1000 or more, and the user tries to use the coupon on a subtotal that is only Rs750, could I show a message along the lines of "your cart must be Rs1000 or more"?


texts: Currency not change in home page, the rest of website works fine

texts:
My store handle many currencies, and if I change the currency, it works in  all pages, but in homepage.

I'm using FPC, but in all pages, currency block is refreshed, but in homepage don't.

I have tried many ways to exclude the blocks from cache, but it seems like the whole homepage is cached, or something like that. so, have you any idea what can I do ?

I see, in chrome the currency not switch in home page. but in firefox and safari the currency switch fine


texts: Changed logo via config, changes not showing on frontend

texts:
I've changed the logo & copyright tagline via Content->Configuration->Edit->Header etc., then flushed the cache, rebuilt the indexes, even recompiled DI, yet the new logo and copyright line aren't propagating through. Theme is the standard blank theme.

What did I miss?

Have tried:

Rebuilding var/generation
Rebuilding var/di
Rebuilding pub/static
Recompiling DI
Rebuilding indexes
Flushing all caches


texts: Cant access setup(or any files) of magento2 in browser

texts:
Installed lamp on centos 7.
Moved files to /var/www/html/

When I chmod 655 magento directory I can see apache welcome screen, but when i try IP_addr/index.php gives:

  "You don't have permission to access /index.php on this server."

When I chmod 755 magento directory I can see only 500 error.

When I follow magento permision setting I can see only 500 error.


texts: There has been an error processing your request kubernetes

texts:
I am trying to deploy Magento using Kubernetes and when I try to access the application I am getting following
There has been an error processing your request
Exception printing is disabled by default for security reasons.

Error log record number: 7b2c0442c678fc4aebf2889b29313a808742bc6eeaa162d96e5de9ada7f48ac3

When I run kubectl -n magento exec magento-php-7cd6df7c98-rngv7 cat  var/report/7b2c0442c678fc4aebf2889b29313a808742bc6eeaa162d96e5de9ada7f48ac3 I get following
{"0":"Please upgrade your database: Run \"bin\/magento setup:upgrade\" from the Magento root directory.\nThe following modules are outdated:\nMagento_AuthorizenetAcceptjs data: current version - non

As suggested when I try to run kubectl -n magento exec magento-php-7cd6df7c98-rngv7 php bin/magento setup:upgrade I am getting following
Use 'kubectl describe pod/magento-php-7cd6df7c98-rngv7 -n magento' to see all of the containers in this pod.Cache cleared successfully File system cleanup:FilesystemIterator::__construct(/var/www/html/pub/static/lost+found):
failed to open dir: Permission denied command terminated with exit code 1

Install.yaml looks like following
spec:
      containers:
      - name: magento-setup
        image: kiweeteam/magento2:vanilla-2.3.4-php7.3-fpm
        securityContext:
          runAsUser: 0
        command: ["/bin/sh"]
        args:
        - -c
        - |
          chown -R www-data:www-data /var/www/html/pub/*
          /bin/bash <<'EOF'
          bin/install.sh
          php bin/magento setup:perf:generate-fixtures setup/performance-toolkit/profiles/ce/small.xml
          magerun index:list | awk '{print $2}' | tail -n+4 | xargs -I{} magerun index:set-mode schedule {}
          magerun cache:flush
          EOF


texts: Get ID of newly created product attribute option

texts:
In my magento store I am creating a new product attribute option as so:

$new_name = 'my-new-option';

$_attribute =  Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', 'my-attribute');
$_options = $_attribute->getSource()->getAllOptions(true, true);
foreach ($_options as $opt) {
    if($opt['label'] === $new_name)
    {
        $exists = true;
        break;
    }
}

if (!$exists)
{
    $option['attribute_id'] = 141;
    $option['value'][0][0] = $new_name;
    $setup = new Mage_Eav_Model_Entity_Setup('core_setup');
    $setup->addAttributeOption($option);
}

This works but after adding the option i need to return the value/id to use further down my script. How can I do so?


texts:
Right now I have my product pages set up with the Request A Quote Button at the bottom of the page. I'd like to move this to the top of the page, as well as get rid of the "Add to Compare" Option and "Email to a friend".

I can't not figure out which file folder I am supposed to be in. Any help would be appreciated - thank you!

http://www.minnesotacomputers.com/sun-t1000-power-supply-300-1799.html


texts: Show custom Credit/Debit card form on Payment Page

texts:
I am working on a project magento 2.2 and client to show only Credit/Debit card form (backend connected with paypal, means we can use Paypal Express Checkout)

But client want not to show list or event Paypal Express Checkout as a payment method but client want to show that Popup occur on that page. (having option to log-in with paypal or pay with debit/credit card)

I have tried custom payment extension by webkul but it didn't work.

One more way I have in my mind, that what if I show that Paypal popup in an iframe instead of list of payments.

Will it workable ?


texts: Magento 1.14 admin page showing 404 error

texts:
We have a scenario where 5000 + admin user needs to access Magento 1.14 admin panel. It is not necessary that they will all need to access admin panel concurrently.  If a single user logs in, the page spins for a couple of minutes and then shows 404 errors.   If we delete the users to less than 300, the page loads perfectly.
Can anyone help us to resolve the issue?  Is there any restriction in creating a number of admin users?  If so, please suggest an alternative method to have 5000 + admin users.


texts: Need help on event and observer in magento 1.9.x.x checkout_onepage_controller_success_action

texts:
I need to listen to the events in the checkout onepage with an observer. The goal is to count the number of times that a command is passed by a user and at the end of the tenth command, I offer him/her a gift.

So this is my config.xml with event

<frontend>
    <events>
        <checkout_onepage_controller_success_action>
            <observers>
                <observe_order_pour_mails>
                    <type>singleton</type>
                    <class>mymodule_custom/observer</class>
                    <method>countOrder</method>
                </observe_order_pour_mails>
            </observers>
        </checkout_onepage_controller_success_action>
    </events>
</frontend>

and this is my observer

<?php

 class Mymodule_Custom_Model_Observer extends Varien_Event_Observer {

 public function __construct() {}

/**
 * @param $observer
 */
public function countOrder($observer) {

    //$from_date = date("Y-m-d h:m:s", strtotime(2016-9-11));
    //$to_date = date("Y-m-d h:m:s", strtotime(2017-9-13));

    $customer_groupId = Mage::getSingleton('customer/session')->getCustomerGroupId();

    $ii = 0 ; // init counter
    $order = $observer->getEvent()->getOrderIds(); // get event of orderIds

    Mage::log(count($order), null, 'order.log'); // count order , always equals 1 in log

    if(count($order) > 0 ){

        $ii++; // counter

        Mage::log( $ii, null, 'counter.log');

        if ($ii = 10){ // if counter of order = 2 , one customer win

             Mage::log('win', null, 'win.log');
             $ii = 0 ; // réinit counter when order = 2
        }

    }
 }

I need that at the end of the command, the user wins and receives an email to warn him/her that he/she has won. I would like that once this is done, the count will reset to zero and that another user can also win for a given period.

Thank you for helping me because I am a little lost


texts:
How to move privacy-policy-link to copyright?

I have tried below code but this not work:

<move element="privacy-policy-link" destination="copyright"/>

Any idea?


texts: Magento 2 change Mobile Footer background color

texts:
How can I change the background-color of the footer on mobile devices?
I have changed the background-color of the footer on desktop with "@footer__background-color: #1D1D1D;".

What less variable is for mobile footer background?
Thanks alot!


texts:
I have a Magento2.3.4 installation.

The issue is that the product count on layered navigation is wrong. When I am selecting an option the products showing on the grid are correct.


texts:
I'd like to know better the customers as people: for example a report that show me how many people are from a specific country or how many people have a specific dog or smartphone ecc... (all the information that i want to retrieve are inserted at sign up also with custom attribute).

There is a method in magento to create such report?


texts:
I want to apply a discount only on this product but I created this rule it applies to all products in the shopping cart if the product is in the shopping cart.
please help me to understand why it applies to another product.


texts:
I am using below mention code for if already have account it ask to login else it display not available

<?php
  $email=$_POST['email'];

        if($_POST['email']){
       $customer = Mage::getModel('customer/customer');
        $customer->setWebsiteId(Mage::app()->getWebsite()->getId());
        $customer->loadByEmail($email);
        if ($customer->getId()) {
        echo "available"; ?>

        <?php echo $this->getMessagesBlock()->getGroupedHtml() ?>
        <form id="login-form" action="<?php echo $this->getPostAction() ?>" method="post">
        <fieldset>
            <?php echo $this->getBlockHtml('formkey'); ?>

                    *<?php echo $this->__('Email Address') ?>

                        <input type="text" class="input-text required-entry validate-email" id="login-email" name="login[username]" value="<?php echo $this->escapeHtml($this->getUsername()) ?>" />

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

                        <input type="password" class="input-text required-entry" id="login-password" name="login[password]" />

                <?php echo $this->getChildHtml('form.additional.info'); ?>
                <?php echo $this->getChildHtml('persistent.remember.me'); ?>

            <input name="context" type="hidden" value="checkout" />
        </fieldset>
        </form>

<?php echo $this->__('* Required Fields') ?>

            <button type="submit" class="button" onclick="onepageLogin(this)"><?php echo $this->__('Login') ?></button>
             <a href="<?php echo $this->getUrl('customer/account/forgotpassword') ?>" class="f-left"><?php echo $this->__('Forgot your password?') ?>

    <?php
        }
        else{
            echo"not available";
        }

}

?>
        <form id="myform" name ="myform" method="POST">
                <input placeholder="Email Address" type="email" name="email" id= "email" class="input-text " required />

                <button class="button" name="submit" onclick="emailcheck();"/> <?php echo $this->__('Submit') ?> </button>
        </form>

But my problem is after login for is displayed but it's not logged in?


texts:
I need to reindex individual products after updating price in EE 1.10.1.1 - this post:
Reindex single product shows a way to do that in CE 1.6 but I think EE 1.10 might correspond to CE 1.5.

Anyway, I believe I might have to go directly to the database tables to do this but I haven't had any success finding the exact tables that need to be changed to update the price.  I have tried catalog_product_flat_1, catalog_product_entity_decimal, and a few others.  I clear cache but the prices aren't changing.

Any thoughts would be appreciated.


texts:
Does Magento allow customer group pricing for configurable products that are not the same per configuration. Let me explain.

If you have a Retail price for a configurable product of $40.00. There are two configurable products. Large and Small. There is also a group price of each, however the pricing of these two products for the group ID is not logically discounted.

Retail - $40.00 Small
Retail - $50.00 Large
Group Price - $15.00 Small
Group Price - $36.00 Large

You can see the discount group pricing is not across the board equal. The group price is not simple -$10.00 for each product, Large and Small. Ideas?  Hope this makes sense.


texts: How to get current page number from url in Magento 2

texts:
I want to check the page number which appears in a URL in a phtml file.
For example, if the URL is:

  http://localhost/magento/index.php/shop.html?p=4

How can I get the value 4 in the .phtml file?

I am using code:

<?php $this->getRequest()->getParam('p')?>

But it does not work in the phtml file. I am using Magento 2.3.2.


texts: How to add an export button in the urlRewite module

texts:
I wanted to add a new button to export all URL addresses from my store.
Unfortunately, this module is so weirdly constructed that I can't understand it.
Anyone of you doing something similar? Or knows how to do it?


texts: Setup:upgrade error after upgrade to Magento 2.3.3

texts:
I just upgrade my Magento 2.2.5 to 2.3.3 , and After running bin/magento setup:upgrade i got the following error:

Warning: Illegal string offset 'max_items' in  vendor/magento/framework/App/Config/Scope/Converter.php on line 41

core_config_data


texts: MCRYPT_BLOWFISH Error in magento server migration

texts:
I'm getting this error followed in the Magento exception.log. I made a migration to a new server running PHP7 + and the mcrypt module is working.

[2018-04-14 13:54:44] main.CRITICAL: Warning: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\jcell\vendor\magento\framework\Encryption\Encryptor.php on line 397 {"exception":"[object] (Exception(code: 0): Warning: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH' (this will throw an Error in a future version of PHP) in C:\\xampp\\htdocs\\jcell\\vendor\\magento\\framework\\Encryption\\Encryptor.php on line 397 at C:\\xampp\\htdocs\\jcell\\vendor\\magento\\framework\\App\\ErrorHandler.php:61)"} []
[2018-04-14 13:54:46] main.CRITICAL: Warning: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH' (this will throw an Error in a future version of PHP) in C:\xampp\htdocs\jcell\vendor\magento\framework\Encryption\Encryptor.php on line 397 {"exception":"[object] (Exception(code: 0): Warning: Use of undefined constant MCRYPT_BLOWFISH - assumed 'MCRYPT_BLOWFISH' (this will throw an Error in a future version of PHP) in C:\\xampp\\htdocs\\jcell\\vendor\\magento\\framework\\Encryption\\Encryptor.php on line 397 at C:\\xampp\\htdocs\\jcell\\vendor\\magento\\framework\\App\\ErrorHandler.php:61)"} []


texts: I have Banner Slider extension on my website. I would like to add Promotional Banner that appears for some customer after login. For this, is there any extension or need to customize that slider?


texts: Get All Orders With Credit Card Payment Method

texts: How to get all the orders with the 'ccsave' as the payment method?


texts: How to save serialized value into a table in magento

texts:
In my custom model I want to store the data in serialized form. For achieving it by myself I have done the following thing but instead of all this 0 is getting stored against value

In my class Inchoo_Custombuilders_Model_Mysql4_Cableconnector extends Mage_Core_Model_MySql4_Abstract file

 $this->_serializableFields = array(
        'cable_id' => array(null, array())
    );

I also tried override the _beforeSave Action

 protected function _beforeSave()
 {
    if(is_array($this->getValue())){
        var_dump($this->getValue());die();
        $this->setValue(serialize($this->getValue()));
    }
 }

And I cannot change the database table design because some functionality that is build on the frontend is running from this table only.

What is the proper way to save serialize data into database in Magento.


texts:
I'm trying to remove the trailing slash from this link:

href="<?php echo Mage::helper('supermenu')->getLinkbyItem($item); ?>"

In the module there is a field that one uses to enter the link used in the above.  I enter the link such as christmas.html but the link gets a trailing slash like this: .../christmas.html/

I found this Remove Trailing Slash From String PHP
 using rtrimbut don't know how to use it in this context.


texts: Magento 1 check if any of cross sell items are in stock

texts:
How can I check if any of the cross sell items are in stock in our Magento 1 store?

I want to load some php if rule, that only display a text line, if any of the cross sell items are in stock.

My current foreach code:

<?php foreach($this->getItems() as $_item): ?>
<?php $productqty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_item)->getQty(); ?>

<?php if ($productqty > 0):?>


texts:
Guys i want to apply discount on every 3 product pack, For example if customer bought 3 product from a specific category he will get $5 discount. But if he buy 4 or 5 products from same category then discount should apply on 3 pack. And remaining 2 product price will be same.

And same discount will be applied for multiple of 3 , 6 ,9 , 12, 15 and so on..

Thanks for the help..


texts: Magento Quick Search to look into custom attributes with conditions?

texts:
I have a requirement where if any integer is there in Magento quick search string, then do a search looking for product SKU and custom attributes. But if there are no integers in the search string, then search looking in product Name and Description.

Let's say the query string has 12345 in it, then I would want to do a LIKE search in the product attributes SKU and few other custom attributes. But if there is no integer in the query string, then I would want to do a FULLTEXT search in the product Name and Description only. Makes sense?

I have looked into CatalogSearch/Model/Resource/Fulltext.php -> prepareResult() but can't figure out how to filter results based on query string. Also, the quick search is using catalogsearch/result model to search, whereas here we may need to look into catalog/product?

I am lost, any help would be greatly appreciated!


texts: Magento 2 Installation: getting stuck without error at "Installing user configuration."

texts:
I have installed Composer and followed the steps to install Magento2. It will be stuck at 93%. It isn't giving any proper error...

Please check the image:

Also, it will display in configuration, as below image.

We got an error in:

  "Installing user configuration."

Is someone facing same issue? If so, how did you resolve this issue?


texts: Folder App/code and App/design Difference?

texts:
when i turned on template path hints, i saw the .phtml links forex:

frontend\base\default\template\page/1column.phtml

which means  page is the module which located on app/design/frontend\base\default\layout\page.xml

so i thought the block settings is on the XML while the code is on the template path

on the other hand when i turned on Add block name to hints it came out Mage_Page_Block_Html which i can found on App\code\core/mage/page/block/html.php

so i thought the block code is on 1column.pthml and what is html.php code contains? why is it differs?


texts:
i  i am moving the site form old domain to new domain,

i am getting error as like this :

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.sales_flat_order' doesn't exist

please help me to find solution

thanks in advance


texts: Position Static Block under Category Grid

texts: I have 3 categories set up to display Static Block & Products however I would like the static block to be displayed under the category grid. As this is not for every category only a few is there a way to achieve this  either using the Custom Layout Update tab or similar solution.


texts: How do I add a Custom Attribute to a Grouped Product

texts:
I have bought a template Smartwave Porto which has a feature called Featured Products. In order to display a featured product a custom attribute is used called sw_feature which is used to toggle whether said product is a featured product. It appears that this attribute is only available on simple products.

How do I make it so that I can use this attribute (or any other custom attribute) on other product types. It seems that Group Products are restricted to certain attributes.

Thanks.


texts: How can i add "Add to Cart" options on my new products custom slider

texts: I need to add Add to cart Options on new products custom slider on home page.


texts: Magento 2 getExtensionAttributes return null

texts:
I am writing an Observer to Magento\Customer\Account\Index but the Objects from class \Magento\Customer\Model\Customer return null when getExtensionAttributes is executed.

  $customer = $customerFactory->create()->load($customerID);
  //$customerRepository->get($customerID);
    $ext = $customer->getExtensionAttributes();
    if($ext == null){
        throw new \Exception(" var ext = null");
    }

I used CustomerRepository and CustomerFactory to get $customer


texts: How to add a custom field in product_form.xml, or rather, to the 'Search Engine Optimization' section.


texts: In Magento 2.2.5, logo is not changing in custom mail

texts:
In Magento 2.2.5, I am adding some custom mail functionality. It is triggering with the content. But the mail logo is not changed. Here is mail template content.

Changed mail logo in Admin panel - theme edit -> Transactional mail. Even changed in the theme folder too. It is not affecting. Any mistake am doing.


texts:
When I am trying to run cron.php I get the following error:

  SQLSTATE[42S22]: Column not found: 1054 Unknown column 'host' in
  'where clause', query was: SELECT main_table.* FROM cron_schedule
  AS main_table WHERE (status = 'running') AND (host =
  'web02.myhost.ro')

The message is correct, there is no 'host' column in the 'cron_schedule' but why is it looking for it and where is this set up? Or what else can I do to get cron running.

I am using Magento 1.9.1.0


texts: Magento 2 : Call custom file in virtual product view page

texts:
I want to call my custom phtml file in virtual product's view page. That file will call within form of that page so my data are post on add to cart.

I already develop a code for this purpose and working fine on add to cart page.But when I am on update cart page of this product that time file is not calling.

Please have a look :

namespace/mymodule/view/frontend/layout/catalog_product_view_type_virtual.xml

<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <body>
      <referenceContainer name="product.info.main">
           <block class="Namespace\Modulename\Block\Product\View\Type\Virtual" template="Namespace_Modulename::product/view/type/virtual.phtml"/>
      </referenceContainer>
   </body>
</page>


texts: how create a shopping cart rule buy 1 prod A and 1 prod B, receive free 1 prod c?

texts:
Hi for holiday i do create a grouped product and i need create a rule for add a free product when the order include the group. how the rules don't works for group directly  i thing the rule

If (buy 1 product A and 1 Product B) receive 1 Product C and free shipping

I control extra the min total amount( = to grouped total) and if the product are deleted.

This produce the effect, if the customer take the group product, but if a client buy one of sku and more than total bypass the rule.

exist a way to write this order or is better start to write a extension to add group products to shopping rules?


texts: Magento 2 Fail to updating the mini-cart on right top corner

texts:
Sometimes the mini cart show "You have no items in your shopping cart." but indeed there are some items in cart. I wrote a function to refresh the mini cart in order to avoid the problem above.

I tried to modify and use the core functions below to refresh it but without success.
Magento\Checkout\Observer\LoadCustomerQuoteObserver:

public function execute(\Magento\Framework\Event\Observer $observer)
    {
        try {
            $this->checkoutSession->loadCustomerQuote();
        } catch (\Magento\Framework\Exception\LocalizedException $e) {
            $this->messageManager->addError($e->getMessage());
        } catch (\Exception $e) {
            $this->messageManager->addException($e, __('Load customer quote error'));
        }
    }

Magento\Checkout\Controller\Cart\UpdatePost:

protected function _updateShoppingCart()
    {
        try {
            $cartData = $this->cart->getQuote()->getItemsCollection()->getData();
//            $cartData = $this->getRequest()->getParam('cart');
            if (is_array($cartData)) {
                $filter = new \Zend_Filter_LocalizedToNormalized(
                    ['locale' => $this->objectManager->get('Magento\Framework\Locale\ResolverInterface')->getLocale()]
                );
                foreach ($cartData as $index => $data) {
                    if (isset($data['qty'])) {
                        $cartData[$index]['qty'] = $filter->filter(trim($data['qty']));
                    }
                }
                if (!$this->cart->getCustomerSession()->getCustomerId() && $this->cart->getQuote()->getCustomerId()) {
                    $this->cart->getQuote()->setCustomerId(null);
                }

                $cartData = $this->cart->suggestItemsQty($cartData);
                $this->cart->updateItems($cartData)->save();
                error_log('finished update cart');
            }
        } catch (\Magento\Framework\Exception\LocalizedException $e) {
            $this->messageManager->addError(
                $this->objectManager->get('Magento\Framework\Escaper')->escapeHtml($e->getMessage())
            );
        } catch (\Exception $e) {
            $this->messageManager->addException($e, __('We can\'t update the shopping cart.'));
            $this->objectManager->get('Psr\Log\LoggerInterface')->critical($e);
        }
    }

How can I refresh the mini-cart? Thanks in advance.


texts:
I'm new to magento and would like to create a new theme.

I'm trying to make sense in all of it, but I would really like to hear your approach to theming in Magento 2.

So I understood only basics so far - how to start a new theme, register it, etc. But what I seem not to understand is that as soon as I create everything how to change the layout?

app\design\frontend\MyTheme\theme

When I create my theme with a parent /blank I can change(update) the layout in /Magento_Theme/layout/default.xml or deafult_head_blocks.xml - these files update the ones in vendor\magento\theme-frontend-blank\Magento_Theme\layout\*.xml.

My question therefore is how do I find a source of every block/container to edit or move it? Or is it better to create a new /default.xml in which I hide every element and then show it on a right place? What is the "right way" of creating layout? Should I use referenceContainer or create a new one?

Thanks for help.


texts: Abandoned Cart Functionality for Guest User

texts:
For a guest user, there needs to be a provision to capture the details of the cart which is abandoned.The flow should be as below:-

Any guest user/non-logged in user adds the product to the cart and tries to close the browser, then a pop up should appear which would have the details as below:-

Confused or still thinking about it?
Drop your contact details and we'll help you out!

Name
Phone number
Email id

Would be really grateful if someone can provide some kind of solution regarding how to implement this .


texts: Dropdown too long, how to add more columns?

texts:
One of the dropdowns on my main navigation has over 70 items on it so is so long that it goes off the screen, as seen in the image below:

How can I make it so they go across multiple columns so that the dropdown fits on the screen?


texts: getOptionId method returns invalid option ID

texts:
Magento 1.9.0.1

Class: Mage_Eav_Model_Entity_Attribute_Source_Abstract

Method:

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

This method is usually used for obtaining option's ID by option's label:

$attribute = $productModel->getResource()->getAttribute($attribute_code);
// validate attribute
if ($attribute->usesSource()) {
    // load option id by value text
    return $attribute->getSource()->getOptionId($attribute_option);
} else {
    return false;
}

This method works well for text labels. But in my case option's labels are numbers. E.g:

Option's label is 14.
getAllOptions returns array of options:

array(
array(
    'label' => 1,
    'value' => 14
),
array(
    'label' => 14,
    'value' => 2
)
)

I expect that getOptionId method will return the second element of  the array. But it return the first due to this comparison $option['value'] == $value.

So what is the purpose for the $option['value'] == $value comparison? It turns out that we are comparing a label with option's ID. Is it a bug? or does it have some purpose?


texts:
I am working on checkout/cart page and my task is to move cart summary. I am creating a file in my theme folder app/design/magestore/sample/magento_checkout/layout/checkout_cart_index.xml

and my code is

<?xml version="1.0"?>
<page layout="1column" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
    <move element="checkout.cart.summary" destination="checkout.cart.container" after="checkout.cart.form"/>
    </body>
</page>

I have clear my cache


texts:
In the Mage_Catalog module etc/config.xml there is no  config node.

However, catalog helpers can obviously still be loaded via Mage::helper.

How is this possible?


texts: Admin Websites and category collection queries

texts: I am working on my extension under admin panel for "Add New Product". On this page in the left navigation "Websites and Categories" are present. I want to change some conditions on query of both collection. Where is the location of this collection query.


texts:
How can I add/create Slide-out Panels in custom admin grid, which will appear on click of a link in grid action column?
I have gone through the code of the related product, upsell and cross-sell sections in product edit section and the select block while widget creation because all these have the slide-out panel implementation but wasn't able to get how it is working.


texts:
How to include bootstrap 3 classes in Magento2.

till know i was using

 <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
 <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>.

But i need to remove some css from bootstrap as it is over lapping my current css.


texts: How do I prevent interceptor classes from being generated so I can debug?

texts:
I'm using xdebug to set breakpoints in Magento Commerce, which is installed locally on Ubuntu.  I have a breakpoint set in vendor/magento/framework/App/FrontController.php.  However, that breakpoint never gets hit because Magento is actually using the class generated/code/Magento/Framework/App/FrontController/Interceptor.php when an instance of FrontController is requested.  Here's the line in Http.php that requests an instance of FrontController:

$frontController = $this->_objectManager->get(\Magento\Framework\App\FrontControllerInterface::class);

I tried clearing my generated/code directory, but everything within that directory is recreated when I refresh a page.  I am in developer mode.

How do I prevent these interceptors from being used so that I can set breakpoints within my non-interceptor PHP files?


texts: Shopping Cart Buy One is $15, buy two for 25. Only when buying groups of two does discount apply

texts:
I would like a shopping cart rule that allows the customer to buy one product at regular price and the second one at $5 discount.  BUT I only want this to happen in groups of two.  For example: One is $15, two is $25, three is $40, four is $50, five is 65, six is $75, and so on.  These are simple products.  My current rule is set at a discount of 16.659% on all products which is making one $15, two $25, three $37.50, four $50, five $62.51, six $75.01, and so on.  Is there a way to do it the way I really want?

Rule I'm using is:

If ALL  of these conditions are TRUE :If total quantity  equals or greater than  2  for a subselection of items in cart matching ALL  of these conditions:  SKU  is one of  TXTTS01,TXTTS02,TXTTS03,TXTTS0...
  .


texts: added .html suffix to products & categories but they are not showing with suffix

texts:
decided to go from no suffix to adding the .html suffix in due to an easier time redirecting currently existing urls.
all of my products had been imported without any suffix.
when I switched the categories and products to add the .html suffix in and cleared the cache etc it does not show on any of my current products but when I import new products the suffix does show up.
Can anyone help me figure out how to get my preexisting products and categories to also have the .html suffix?

I found that if I hid the category from the menu and then unhid it, that the suffix appeared for that category and all the products within that category.